Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754803AbdGKApE (ORCPT ); Mon, 10 Jul 2017 20:45:04 -0400 Received: from regular1.263xmail.com ([211.150.99.135]:54717 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbdGKApD (ORCPT ); Mon, 10 Jul 2017 20:45:03 -0400 X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 X-RL-SENDER: mark.yao@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: mark.yao@rock-chips.com X-UNIQUE-TAG: <62dcd7970715bf59dcc52581c8a0ee0b> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH] drm/rockchip: fix NULL check on devm_kzalloc() return value To: Sean Paul References: <20170706215833.GA25411@embeddedgus> <595EDC3C.1010801@rock-chips.com> <20170710190452.6nzd4tihronl5m5n@art_vandelay> Cc: "Gustavo A. R. Silva" , David Airlie , Heiko Stuebner , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org From: Mark yao Message-ID: <59641F86.4010902@rock-chips.com> Date: Tue, 11 Jul 2017 08:44:54 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20170710190452.6nzd4tihronl5m5n@art_vandelay> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1790 Lines: 64 On 2017年07月11日 03:04, Sean Paul wrote: > On Fri, Jul 07, 2017 at 08:56:28AM +0800, Mark yao wrote: >> On 2017年07月07日 05:58, Gustavo A. R. Silva wrote: >>> The right variable to check here is port, not dp. >>> >>> This issue was detected using Coccinelle and the following semantic patch: >>> >>> @@ >>> expression x; >>> identifier fld; >>> @@ >>> >>> * x = devm_kzalloc(...); >>> ... when != x == NULL >>> x->fld >>> >>> Signed-off-by: Gustavo A. R. Silva >> Thanks for the fix, >> >> Acked-by: Mark Yao > Hi Mark, > I've applied this patch, but in the future, please apply changes directly > instead of just acking. > > If you're unable to apply it for some reason (vacation, etc), please reach out to > one of the -misc maintainers via email or irc so we don't inadvertently lose track > of it on the list. > > Sean Hi Sean Got it, I will do it right next time. Thanks to inform me this, > >>> --- >>> drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c >>> index 14fa1f8..9b0b058 100644 >>> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c >>> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c >>> @@ -1195,7 +1195,7 @@ static int cdn_dp_probe(struct platform_device *pdev) >>> continue; >>> port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL); >>> - if (!dp) >>> + if (!port) >>> return -ENOMEM; >>> port->extcon = extcon; >> >> -- >> Mark Yao >> >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Mark Yao