From patchwork Thu Aug 31 23:29:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9933101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A37260309 for ; Thu, 31 Aug 2017 23:42:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F946268AE for ; Thu, 31 Aug 2017 23:42:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 446F226E4E; Thu, 31 Aug 2017 23:42:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5684268AE for ; Thu, 31 Aug 2017 23:42:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751835AbdHaXjU (ORCPT ); Thu, 31 Aug 2017 19:39:20 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:33325 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751404AbdHaXjT (ORCPT ); Thu, 31 Aug 2017 19:39:19 -0400 Received: by mail-pg0-f49.google.com with SMTP id t3so3289578pgt.0 for ; Thu, 31 Aug 2017 16:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ydmbspRBlYMFfn+Yf6LSh+YkPokyaptCE65Ki4N4RsI=; b=Q3YQzqMwk/wX6QDDYi6he0tGur8AqIFr0c9KM5yokRU86IV2oQnDliOyrJx4ACX//g GUl8evfs+IzJThHiU9ujwaK6LQvtN3sGMjh+gTtBvDWLjX5sP1tDNTlHB3GmBIQBuNTl ik+ggacynyezCVVtIj27SqDtybZr12HFWsTeg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ydmbspRBlYMFfn+Yf6LSh+YkPokyaptCE65Ki4N4RsI=; b=pli8Ls3vhE/lSYdXgH+DRzLNLQg8nB8t351uQk4sOWf6lvx45Buek9BACqIEnefKWw MQ1yO8KI0pPpaj/89eztxxAzAM+zyLa5qSYOKKO0Xr1CEcn670Uty9pLambpYLnjrZ0f jruPl9kx2IslOsjh53W3CyBOoxuZ0HcQgfB9GTfbeg6qd+Il5Em/qQb9wpc89WVO0dkH ngwyqimIn2YpRXdId9guPimgTveQ9qQdMpNgNDOGogqbTCF9aFWz64HCBhuEcO/1K82+ hUacgdOUjTH3ZaMSbQKfdgpGEnUMAPdPeSmeH+vQ3pvv0pDPHwW3qtduFBLIIHZ0yEfA YJtQ== X-Gm-Message-State: AHPjjUhG22+2Vi+Zj8Ds3/LNDrWEyDi9zSqAa7+7rY7QQIXgF9GHJ99C +BtPjFwLQeB6r9yU X-Google-Smtp-Source: ADKCNb6OxfefdNDvPTsV2KriYDh599b6NDLsynhd8wBCZFX1dM8W4v6XlFmju2UsrTJ9vIEQ2GSW5g== X-Received: by 10.99.134.65 with SMTP id x62mr170282pgd.290.1504222758817; Thu, 31 Aug 2017 16:39:18 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id e3sm839652pga.74.2017.08.31.16.39.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Aug 2017 16:39:17 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Cc: Kees Cook , Mats Randgaard , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/31] media/i2c/tc358743: Initialize timer Date: Thu, 31 Aug 2017 16:29:29 -0700 Message-Id: <1504222183-61202-18-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504222183-61202-1-git-send-email-keescook@chromium.org> References: <1504222183-61202-1-git-send-email-keescook@chromium.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This converts to use setup_timer() to set callback and data, though it doesn't look like this would have worked with timer checking enabled since no init_timer() was ever called before. Cc: Mats Randgaard Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Kees Cook --- drivers/media/i2c/tc358743.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 5788af238b86..94e722e0f4e0 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1964,8 +1964,8 @@ static int tc358743_probe(struct i2c_client *client, } else { INIT_WORK(&state->work_i2c_poll, tc358743_work_i2c_poll); - state->timer.data = (unsigned long)state; - state->timer.function = tc358743_irq_poll_timer; + setup_timer(&state->timer, tc358743_irq_poll_timer, + (unsigned long)state); state->timer.expires = jiffies + msecs_to_jiffies(POLL_INTERVAL_MS); add_timer(&state->timer);