Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1479050imm; Wed, 26 Sep 2018 19:36:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV6017RZBF3XyFe/nJp9dQE+OMNo3s2bxgx1zkdBrk69N61LqtJ40FTGUPG8gMzAg4i3i5Pue X-Received: by 2002:a62:2904:: with SMTP id p4-v6mr9007344pfp.128.1538015811238; Wed, 26 Sep 2018 19:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538015811; cv=none; d=google.com; s=arc-20160816; b=FoBlsQ067U/HrJTFy2mz6OvFMsCkr68xwQgwyOjev0UxpdJe2rbGVo7G+WgexkwiYL utcvUblmSzN/UFCecnnmHi/L9ZbYoQivw8NhhFMWab9U+jFZl8IqWHtluQsCKnGtz3V9 ZupZ54mwmnQFhFZ4o06J2tcmcdsk0qOJ1hPDkVbzatXv7G+Oy0VFl6RumVDNZLOXbCoh FSrKepS87lM/nHoK4DbNitvROidS8sKGt+z6p0bESwSf+SGGWCww6tVxu6nn+3L6xBvd 1kuwSRe3EaubhUWXVMxKA1MYNlIe/NWr97zFNd7ZJjqrv+uvCoR2oT3IxFmcgU9+LTq6 XVEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:content-transfer-encoding:date :message-id:in-reply-to:cc:to:from:reply-to:subject:mime-version :dkim-signature:dkim-filter; bh=za60Zgc4i8rWpm9TmFc5Xwo1Cgu6xOcLbE0wQNh3qUE=; b=tmEIBqI/Gmu+M9uUPXZhEOLHu85PzxVKxcTyqTEdO0MdKL/AMkGI+pTPClN6hztmXo h8pdAWdgU2kNDIZ/5zqvuvNJaHoI8GYDFSgkmKM5FuYapnoF0VE9udyfHVc8g5eIQv8v KA6QxB39Jh+AO0JTFZxNHu9eCRQJp3OWKkb1BIy3nl8CSEAxkmOJ1VOThl2PB3AJwL8u BHYbnQ/lWoyowGzLXmlQhI8XcX3h5wyZIeMCRhe+S0noprALbrJDTT8IUp+RPxWecER9 pFBPpoW6A/7hOWac9C9stxtj6MeCts8fMFUM4LdTMDAKXRKSRI/Dj4qSSj+urQSbJ9r4 35WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=p78YxPGL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si710452plt.19.2018.09.26.19.36.04; Wed, 26 Sep 2018 19:36:51 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=p78YxPGL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727245AbeI0IqC (ORCPT + 99 others); Thu, 27 Sep 2018 04:46:02 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:52044 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726924AbeI0IqC (ORCPT ); Thu, 27 Sep 2018 04:46:02 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20180927023003epoutp04820b75dd210b70237243ad74bd80d322~YINxgQfQr1919219192epoutp04Z for ; Thu, 27 Sep 2018 02:30:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20180927023003epoutp04820b75dd210b70237243ad74bd80d322~YINxgQfQr1919219192epoutp04Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1538015403; bh=za60Zgc4i8rWpm9TmFc5Xwo1Cgu6xOcLbE0wQNh3qUE=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=p78YxPGLhTwYLNH8hwFvLnTwULct6pDyzj5l97qSOaq7YsOr+EVKs+VQYL7mFYIfU QliaHZWWV4+Ws7najulPiChcu7+BNLnSccrXnt8+Xn5OqWObeZ7/sUysE3A1cNPeKe 4kNvO+iBFDxrlH39Yj/gV9z/sQKlDD1yniiqXAjQ= Received: from epcpmgr01 (u28.gpu120.samsung.co.kr [203.254.230.28]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20180927023003epcas1p215bc29cbab333035f418368676847bf2~YINw-r7Ci0571505715epcas1p2j; Thu, 27 Sep 2018 02:30:03 +0000 (GMT) Mime-Version: 1.0 Subject: RE: [PATCH] PM / devfreq: remove redundant null pointer check before kfree Reply-To: myungjoo.ham@samsung.com From: MyungJoo Ham To: zhong jiang , Kyungmin Park CC: Chanwoo Choi , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <1537535923-46240-1-git-send-email-zhongjiang@huawei.com> X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <529236451.01538015400755.JavaMail.epsvc@epcpmgr01> Date: Thu, 27 Sep 2018 11:25:36 +0900 X-CMS-MailID: 20180927022536epcms1p7377840ca08dabad3a7f4007630390b80 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-CPGSPASS: Y X-CPGSPASS: Y X-Hop-Count: 3 X-CMS-RootMailID: 20180921133110epcas4p3d2914c21c881e2dfb6a2e2d9708f7a43 References: <1537535923-46240-1-git-send-email-zhongjiang@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =C2=A0 > kfree has taken the null pointer into account. hence it is safe > to remove the redundant null pointer check before kfree. >=20 > Signed-off-by: zhong jiang Acked-by: MyungJoo Ham > --- > drivers/devfreq/devfreq.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c > index 4c49bb1..c37021d 100644 > --- a/drivers/devfreq/devfreq.c > +++ b/drivers/devfreq/devfreq.c > @@ -675,8 +675,7 @@ struct devfreq *devfreq_add_device(struct device *dev= , > =09device_unregister(&devfreq->dev); > =09devfreq =3D NULL; > err_dev: > -=09if (devfreq) > -=09=09kfree(devfreq); > +=09kfree(devfreq); > err_out: > =09return ERR_PTR(err); > } > --=20 > 1.7.12.4 =C2=A0 -- MyungJoo Ham (=ED=95=A8=EB=AA=85=EC=A3=BC), Ph.D. Autonomous Machine Lab., AI Center,=C2=A0Samsung Research. Cell: +82-10-6714-2858