From patchwork Wed Sep 20 23:27:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9962985 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 7D1E460208 for ; Wed, 20 Sep 2017 23:39:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F6C829267 for ; Wed, 20 Sep 2017 23:39:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 643622926F; Wed, 20 Sep 2017 23:39:51 +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 EB2A429267 for ; Wed, 20 Sep 2017 23:39:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752218AbdITXjf (ORCPT ); Wed, 20 Sep 2017 19:39:35 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:54574 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752128AbdITXiD (ORCPT ); Wed, 20 Sep 2017 19:38:03 -0400 Received: by mail-pf0-f181.google.com with SMTP id d187so2297951pfg.11 for ; Wed, 20 Sep 2017 16:38:03 -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=j5hFkwkwtSx8d8NWn3wAWyu6ETBXFEYEuKx11ZMqfHc=; b=OaOc3I8/uYlUmmtP2mnlf/II8u/dCQjBGsoVQj8mqxx6+OIDOY5+nBUL29O015HxbC h2Y18Vo7LrHxM4chkDYj+Ka7DBeaNHwqwFAzurQ4KFoVOND00dYKcwdveEilyWVTok8m gEiho89tu5+AV0hWwXrgoqb9DvH0p1oV1kyRY= 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=j5hFkwkwtSx8d8NWn3wAWyu6ETBXFEYEuKx11ZMqfHc=; b=SXl27kiIe8OW17z5GcUyKk2QubdOCKSNRLxjQj9hlxU0D2x0i59gAR5J5PO67h44x0 IRPt6iqGTWnWsTS0MZQPTG4+8IScX4I//wbMgBiSiS2s7Wc8C2guJSMdRBJgb9EOQR89 sHGnUBTTV1RQQN3/Y4P/PKXz0WvKCd7+QX66Lhb/fsIIemU7XEYtBEkypR73mNlLLwjm MPFEluqjKgNrN3wF85qBUCEYmODrCLEeIvaFaRbp4i2KTGmrvSiTUy/HT5MyAJu6pKEA /plFHSHHtZQH0uRPu+oKZK3NSyX+aYu6XhhewykFyc08eZFGWiQ3uc6BwN0Urq9ySvbE gX2A== X-Gm-Message-State: AHPjjUhDe2biMAAcP9kgHVg85ZUAJa1oEPyfMDkFuCZsq9wIiqCGMLll K8v4ygzKsbbawWWJ92tPjSktNg== X-Google-Smtp-Source: AOwi7QC9zK2D31ziLUc7OHsaFtx69jERbvadNWV+gF38texQYcdqx9gE5GBsxd/gYIjGRh4DRSqQYA== X-Received: by 10.99.172.69 with SMTP id z5mr3871299pgn.46.1505950682995; Wed, 20 Sep 2017 16:38:02 -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 n4sm48549pfn.177.2017.09.20.16.37.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Sep 2017 16:37:54 -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 v2 17/31] media/i2c/tc358743: Initialize timer Date: Wed, 20 Sep 2017 16:27:41 -0700 Message-Id: <1505950075-50223-18-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505950075-50223-1-git-send-email-keescook@chromium.org> References: <1505950075-50223-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 e6f5c363ccab..07ad6a3ff1ec 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);