Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752702AbdIBN4J (ORCPT ); Sat, 2 Sep 2017 09:56:09 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:60563 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbdIBN4H (ORCPT ); Sat, 2 Sep 2017 09:56:07 -0400 From: "Rafael J. Wysocki" To: Kees Cook Cc: Thomas Gleixner , Pavel Machek , Len Brown , Greg Kroah-Hartman , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Sean Hefty , Hal Rosenstock , Dmitry Torokhov , Jeff Kirsher , linux-pm@vger.kernel.org, linux-rdma@vger.kernel.org, linux-input@vger.kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 31/31] timer: Switch to testing for .function instead of .data Date: Sat, 02 Sep 2017 15:47:20 +0200 Message-ID: <1857082.urnTVIQKcg@aspire.rjw.lan> In-Reply-To: <1504222183-61202-32-git-send-email-keescook@chromium.org> References: <1504222183-61202-1-git-send-email-keescook@chromium.org> <1504222183-61202-32-git-send-email-keescook@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2177 Lines: 54 On Friday, September 1, 2017 1:29:43 AM CEST Kees Cook wrote: > In several places, .data is checked for initialization to gate early > calls to del_timer_sync(). Checking for .function is equally valid, so > switch to this in all callers. > > Cc: "Rafael J. Wysocki" > Cc: Pavel Machek > Cc: Len Brown > Cc: Greg Kroah-Hartman > Cc: Mike Marciniszyn > Cc: Dennis Dalessandro > Cc: Doug Ledford > Cc: Sean Hefty > Cc: Hal Rosenstock > Cc: Dmitry Torokhov > Cc: Jeff Kirsher > Cc: linux-pm@vger.kernel.org > Cc: linux-rdma@vger.kernel.org > Cc: linux-input@vger.kernel.org > Cc: intel-wired-lan@lists.osuosl.org > Cc: netdev@vger.kernel.org > Signed-off-by: Kees Cook > --- > drivers/base/power/wakeup.c | 3 +-- > drivers/infiniband/hw/hfi1/chip.c | 6 ++---- > drivers/infiniband/hw/hfi1/init.c | 2 +- > drivers/infiniband/hw/qib/qib_iba7220.c | 2 +- > drivers/infiniband/hw/qib/qib_iba7322.c | 2 +- > drivers/infiniband/hw/qib/qib_init.c | 14 +++++--------- > drivers/infiniband/hw/qib/qib_mad.c | 2 +- > drivers/input/input.c | 5 ++--- > drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- > 9 files changed, 15 insertions(+), 23 deletions(-) > > diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c > index 144e6d8fafc8..79a3c1b204af 100644 > --- a/drivers/base/power/wakeup.c > +++ b/drivers/base/power/wakeup.c > @@ -479,8 +479,7 @@ static bool wakeup_source_not_registered(struct wakeup_source *ws) > * Use timer struct to check if the given source is initialized > * by wakeup_source_add. > */ > - return ws->timer.function != pm_wakeup_timer_fn || > - ws->timer.data != (unsigned long)ws; > + return ws->timer.function != pm_wakeup_timer_fn; > } > > /* Acked-by: Rafael J. Wysocki for the above. Thanks!