Received: by 10.213.65.68 with SMTP id h4csp290209imn; Mon, 26 Mar 2018 22:01:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELvnqtNEimFXxFeAsUuvBv3l5H2Zl1cgYtLpTBXVO1v5yvv1a4UbIAOBFv8mZIgZFCkCj/mf X-Received: by 2002:a17:902:2be4:: with SMTP id l91-v6mr39369623plb.102.1522126917746; Mon, 26 Mar 2018 22:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522126917; cv=none; d=google.com; s=arc-20160816; b=CjcOZQrgY9gUrL78EMoTUAgfPhbvt6OwUxotwqc4LUVkIxoILAHpLN3BzLU8EM314S ELu9WMhvU3NSj7GKwOUjymg8AKhRclm9Hrl2EXprE0kShzqD2u5PR33pluYCXy020PXA SUbh0X8Tlvi2fEp5t9ARmn0w4AubU6G7N3G9cr2t3dbqkGU/+TaZL4o4y15yyXTnYGtG kWWEAPaFQG2FDPuB2JV729huUR2Mvy4lXZT80Zq9aWwXIKBsFB+oKK8XSOnXMdosiA+4 S212zmiwZqd7Z7hrZ60XuHaK85gzNkAkVYvxU9lSuvwo7rneaGTQ4lHMPl5CKpGJJh93 Tigg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type:user-agent :in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:dkim-signature:dkim-filter:arc-authentication-results; bh=YIepli3Y92hMZcH7S4dm8b4P1of++XMDaBX0KOPlyew=; b=QBJnKUWFk0YYVv/rOxb39MxBscADSbSFoj6EK2lz55tPFgrcJJe4EWQl1+FZJdr166 E9A+v4zehHneS+T69kNrFLnFMPgBw/KBRn5XuDrNx6r9sE5VX8w0x3BbSntx6OADhr6a +SDPH/XuwiIy0vODtqsyJMJE+zm/3Mjc0HKVW/XXAohoUaWAErWZPO3r4yWfvUKiN4QZ S+eJd0M0J3JoXTmQGezgjOB7Rd1cqLec4fIueshSztPI2wrDoG/4jiBiGbt2adB/Vu40 oBLNoPNjGuP57SrDAxQb85IZVx26hP1QULWyMlDLrfDSnHg765OcLz920ueq1awriq7l Ie9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=FQRjW7RF; 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 e11-v6si451013plt.683.2018.03.26.22.01.43; Mon, 26 Mar 2018 22:01:57 -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=FQRjW7RF; 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 S1750954AbeC0FAv (ORCPT + 99 others); Tue, 27 Mar 2018 01:00:51 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:63913 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbeC0FAt (ORCPT ); Tue, 27 Mar 2018 01:00:49 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20180327050047epoutp0430784ee03c13fe291454fa7912c8eadc~frk2Gh6oT2585725857epoutp04P; Tue, 27 Mar 2018 05:00:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20180327050047epoutp0430784ee03c13fe291454fa7912c8eadc~frk2Gh6oT2585725857epoutp04P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1522126847; bh=YIepli3Y92hMZcH7S4dm8b4P1of++XMDaBX0KOPlyew=; h=Date:From:To:Cc:Subject:In-reply-to:References:From; b=FQRjW7RF8tgzH15+N+d4btZ/QKrgNlG4oxxfpt9I05dTN9C8T4UecnP7FGFHLhnMR sL9QqA96Q7UCRcVGFTh3bXOwKB0Qxhb/ftKrgBJGS0FdkxZAGjVnGnZjSK4QfCXO9A A4dOLuLy4OFewopk3asTbPKUQ5jwn8zLFnqt9Vgw= Received: from epsmges1p5.samsung.com (unknown [182.195.40.93]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20180327050046epcas1p21cb9bebf2df0deaf2fcc602030a3784f~frk1xYdLw0982609826epcas1p2u; Tue, 27 Mar 2018 05:00:46 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 7F.77.04084.EFFC9BA5; Tue, 27 Mar 2018 14:00:46 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180327050046epcas1p16921ee8b21a013f9a344500c45903e50~frk1iP_Xw2248522485epcas1p1b; Tue, 27 Mar 2018 05:00:46 +0000 (GMT) X-AuditID: b6c32a39-591ff70000000ff4-ef-5ab9cffe1f03 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E4.1D.03849.EFFC9BA5; Tue, 27 Mar 2018 14:00:46 +0900 (KST) Received: from ubuntu ([10.253.107.61]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P6800C5YGLAXL10@mmp2.samsung.com>; Tue, 27 Mar 2018 14:00:46 +0900 (KST) Date: Tue, 27 Mar 2018 14:00:45 +0900 From: Ji-Hun Kim To: gregkh@linuxfoundation.org, dan.carpenter@oracle.com, mchehab@kernel.org Cc: arvind.yadav.cs@gmail.com, ji_hun.kim@samsung.com, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v3 1/2] staging: media: davinci_vpfe: add error handling on kmalloc failure Message-id: <20180327050045.GA12754@ubuntu> MIME-version: 1.0 Content-type: text/plain; charset="us-ascii" Content-disposition: inline In-reply-to: <1521607150-31307-1-git-send-email-ji_hun.kim@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA02SWUwTURSGczvT6ZRYvZbtBqI0o6ig1E5tYWrEYCQyCahN9KkEcYSxEGhL OsWI+iC4Y0VxCVg0KSoYEWWRXQJaFKOioiIqBk1MJMGFYFwwRsC2owlvX/77//ecc+8hMWUR EUZmWx283crlUkQA3tITFRMz9aTdpCl9GsUMHqvEmE9TZTjT2fdbxuy7WEcwxx+2AqZ5KJx5 3nGOYJz1zVKmuvGPJEHOvu3qwdl217CMbaw5QrDd52tl7NcPQzhb0lQD2G+N840yE78qi+cy ebuKt2bYMrOt5ngqeVP62nR9rIaOoQ1MHKWychY+nkpMMcasy871dkapdnC5+V7JyAkCtXz1 Krst38GrsmyCI55KpWmtmtbEqbVarVoXl7ZSq/datvJZ3+pLiLzxWTtflQ9L9wJ3QDGQkwjq UHlxN14MAkglbANoZHpC4jtQwgmADn1S/Dc1nX0kFfV6gCamQsXAKECTD174AziMRD9PDwAf EzAKNRwd9HMQTEFlvz/7K2CwAaAvFX3+mwIhh6pfX/WzAi5FV36dIkSei36deov7GIPL0KPe 60DkcPR+slzmYzlMQkNlXX5/MFyITt9vIXwFEHxHoP5roxKx7UR0+7sTEzkQfbzX5A2TXg5H z+7Gi/Ju5B5ow0Xeg15PV/2LrkDHnP2YWHc2GvvhlIpRBTp8UClaWDQ9Ng5EXoMGKlwy8VFc AJU8b8FPgHmuGeO4Zoz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KvmR+xKf3rKoLWVe AfZBZXuvSZ2Yt8gzp6hyw6/Fy659etXruzd2j5IwX/vfmLOGejoHMq9U9RnJKbEUZyQaajEX FScCAIYTWGB7AgAA X-CMS-MailID: 20180327050046epcas1p16921ee8b21a013f9a344500c45903e50 X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180321043915epcas1p3955f5a57c6728cd1f386f805879fc3f2 X-RootMTR: 20180321043915epcas1p3955f5a57c6728cd1f386f805879fc3f2 References: <1521607150-31307-1-git-send-email-ji_hun.kim@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 21, 2018 at 01:39:09PM +0900, Ji-Hun Kim wrote: > There is no failure checking on the param value which will be allocated > memory by kmalloc. Add a null pointer checking statement. Then goto error: > and return -ENOMEM error code when kmalloc is failed. > > Signed-off-by: Ji-Hun Kim > --- > Changes since v1: > - Return with -ENOMEM directly, instead of goto error: then return. > - [Patch v3 1/2] is same with [patch v2] > > drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c > index 6a3434c..ffcd86d 100644 > --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c > +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c > @@ -1280,6 +1280,9 @@ static int ipipe_s_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg) > > params = kmalloc(sizeof(struct ipipe_module_params), > GFP_KERNEL); > + if (!params) > + return -ENOMEM; > + > to = (void *)params + module_if->param_offset; > size = module_if->param_size; > > @@ -1323,6 +1326,9 @@ static int ipipe_g_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg) > > params = kmalloc(sizeof(struct ipipe_module_params), > GFP_KERNEL); > + if (!params) > + return -ENOMEM; > + > from = (void *)params + module_if->param_offset; > size = module_if->param_size; > > -- > 1.9.1 > > Are there any opinions? I'd like to know how this patch is going. Best regards, Ji-Hun