Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1580705img; Sat, 23 Mar 2019 06:42:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxDcGUqgixNxZjvsf8LVTGDQsQI4kjPy8vc7HHLq6GdGbXmsbhV/Xy2x9bP95sWECRJXsi X-Received: by 2002:a63:5622:: with SMTP id k34mr14093123pgb.123.1553348525905; Sat, 23 Mar 2019 06:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553348525; cv=none; d=google.com; s=arc-20160816; b=KFeffcnXcQ9szp6qSIW2gqWyCPY3rSE7EO0Jg12o3QD99a1cQpGXlzqkkTsaLoYwxy goo/d6MNmXVuMXdjpTImNfkIr+5Zy+6KWYwxhp4tE0+lcqRuIeI/UV5eMFMzgehyhqmF M0n6cI/1ITc/x0dF+ftkpfUKpOur5YGfq6YiFHPNRtr0N+kRGeCQVudoNoFxLx+TDUqy 9Q0rx6v1/6hAky4UupLo2p/WOtal8WFvRCMyGvI2ulhDoxehLJV1VeZGlqadz7xetAsC Is4GzepZThyvVsy+ql38in6VxoKPr+njaivM7jsaTH3pziXYh9xflaGgU55LgUc1gQLJ beNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=1yJuSzVKFsggvPdfX/Eoc8CZYpQjOYWQ2BjUerWFKi4=; b=lKfhk2ysoGGRFV6c1v1WLwbEjO+kzPSYwRS7hy830PM0FTa3nqZiE20N+p/k2gLhov CIZZXruAncjNUyt1qm+mv9XlTq/9qpKoMmA2Irixqbh61TU3RCkVmIn11aE8hM9Vz5H3 NH+42GAA1GJRvQM6sppznTGHPM+wpJxYvas1jYcllCi9K21Eo3CiZQ4kAefiB+aSlbaU nNandZN7+dUs1LZ7FNKTlxBlHF0fputEYeHSNsJosrlJvfbNp1wodFYA1zKjHsF/m/tw IRNmDLvALcMRoHpfa7mRHcGnIK73cvZEc3z1mf/I/st84uvTHlvDg5YOSGwzelJMvl8z /Idg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j19si8975266pfh.124.2019.03.23.06.41.48; Sat, 23 Mar 2019 06:42:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727494AbfCWNlJ (ORCPT + 99 others); Sat, 23 Mar 2019 09:41:09 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:10966 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbfCWNlJ (ORCPT ); Sat, 23 Mar 2019 09:41:09 -0400 X-IronPort-AV: E=Sophos;i="5.60,256,1549926000"; d="scan'208";a="375419243" Received: from abo-58-107-68.mrs.modulonet.fr (HELO hadrien) ([85.68.107.58]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Mar 2019 14:41:07 +0100 Date: Sat, 23 Mar 2019 14:41:07 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Wen Yang cc: yamada.masahiro@socionext.com, linux-kernel@vger.kernel.org, wang.yi59@zte.com.cn, Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr Subject: Re: [PATCH] coccinelle: put_device: reduce false positives In-Reply-To: <1553321671-27749-1-git-send-email-wen.yang99@zte.com.cn> Message-ID: References: <1553321671-27749-1-git-send-email-wen.yang99@zte.com.cn> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 23 Mar 2019, Wen Yang wrote: > Don't complain about a return when this function returns "&pdev->dev". > > Reported-by: Julia Lawall > Signed-off-by: Wen Yang > Cc: Julia Lawall > Cc: Gilles Muller > Cc: Nicolas Palix > Cc: Michal Marek > Cc: Masahiro Yamada > CC: cocci@systeme.lip6.fr > Cc: linux-kernel@vger.kernel.org Acked-by: Julia Lawall > --- > scripts/coccinelle/free/put_device.cocci | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci > index 7395697..c9f071b 100644 > --- a/scripts/coccinelle/free/put_device.cocci > +++ b/scripts/coccinelle/free/put_device.cocci > @@ -32,6 +32,7 @@ if (id == NULL || ...) { ... return ...; } > ( id > | (T2)dev_get_drvdata(&id->dev) > | (T3)platform_get_drvdata(id) > +| &id->dev > ); > | return@p2 ...; > ) > -- > 2.9.5 > >