Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3009451ybx; Fri, 8 Nov 2019 12:39:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxFoLPxN+cznWvYjNdzqhnH12OcSrVVFnbaCZD8SP5Sexp7dA6aozQcDQYUYcZonqR/E/N5 X-Received: by 2002:aa7:c048:: with SMTP id k8mr12574293edo.254.1573245548212; Fri, 08 Nov 2019 12:39:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573245548; cv=none; d=google.com; s=arc-20160816; b=GYOrzShMtY9sAu7qxHWyTXkS0BiYjKcjADt/616vMpsDkUoJiFPGw39ahg5a+pnTe4 72s2hnR4A0gq7YNpfo63zmLqyVinatBV5Mo7QzBI1PkuNxGGVuRZ3gsyigakmdsKlGOB 4CPZ7T7J8H4AW3gPy3AVouUjJP5gP0nmEwqioX8wolx0lCOS0CGBs0aO+OScIoZJbm1V QITgp6oFKZY2AjFuc9/SY/frQF54EZJ7+2q2DmZNJ/PFwjWFn5M2W+Z8dkj3//uAE0tK 592Llb4tQFcM1nlJUg9dOdxS5zupFGWFh8YsBg/IY59sBWZ2bHJCPigXYPlKMqB37TrU SgpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0ISWXzn/ntX7fqzfoZghAwR4xEOUt2axVjZpQiwsJcA=; b=sIg3ME/X0azTAyyXuQqLlRJSI/cVAyh4Nv1bXk+3WxA/b/b5yyFQSQMWKLgdOfQyH6 LLTIWBSA4VvGm9Bk3eZ8ITQVSgxDgQqUYgAqMSeK7bA17yIcXs0empEwVIosODjus6MX 96IgBrkr5nuCGTE9d9+QuY8E8CTHYuVHd/u82qnrXa7XIwDzomE20hVuSTthEDsN9PKZ P2AoRXlwd5CSdd+jtWe/Bty+2tG1xaq83vAqxvJgXOyyEbyuGtpq3srrjRdFG67ySf98 znxuFNKfsqsuHmSLmgzJjCgY0nLxZ9LYWF0qSBZyPjNJc+4Kc/VwV9xeEoeasIPU7wrg Vx0w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f18si4878969ejf.210.2019.11.08.12.38.44; Fri, 08 Nov 2019 12:39:08 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732399AbfKHUiD (ORCPT + 99 others); Fri, 8 Nov 2019 15:38:03 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53628 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726349AbfKHUiB (ORCPT ); Fri, 8 Nov 2019 15:38:01 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xA8KXPHA137890; Fri, 8 Nov 2019 15:37:45 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2w5c3yppjr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Nov 2019 15:37:45 -0500 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id xA8KXeYo139026; Fri, 8 Nov 2019 15:37:44 -0500 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 2w5c3yppj9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Nov 2019 15:37:44 -0500 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id xA8KTvBB014679; Fri, 8 Nov 2019 20:37:43 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma02dal.us.ibm.com with ESMTP id 2w41ukaka9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Nov 2019 20:37:43 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xA8Kbgb140436058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Nov 2019 20:37:43 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C8809AC05F; Fri, 8 Nov 2019 20:37:42 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D1E43AC05E; Fri, 8 Nov 2019 20:37:41 +0000 (GMT) Received: from [9.41.103.158] (unknown [9.41.103.158]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 8 Nov 2019 20:37:41 +0000 (GMT) Subject: Re: [PATCH v3] media: aspeed-video: Fix memory leaks in aspeed_video_probe To: Navid Emamdoost , jae.hyun.yoo@linux.intel.com Cc: linux-aspeed@lists.ozlabs.org, Andrew Jeffery , kjlu@umn.edu, openbmc@lists.ozlabs.org, Eddie James , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, emamd001@umn.edu, smccaman@umn.edu, Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org References: <20191028171838.28533-1-navid.emamdoost@gmail.com> From: Eddie James Message-ID: <6de50e1a-cb05-8d81-d043-00ed25eda845@linux.vnet.ibm.com> Date: Fri, 8 Nov 2019 14:37:41 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <20191028171838.28533-1-navid.emamdoost@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-11-08_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1910280000 definitions=main-1911080198 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/28/19 12:18 PM, Navid Emamdoost wrote: > In the implementation of aspeed_video_probe() the allocated memory for > video should be released if either devm_ioremap_resource() > or aspeed_video_init() or aspeed_video_setup_video() fails. Replace > kzalloc() with devm_kzalloc to avoid explicit release for video. Thanks, Reviewed-by: Eddie James > > Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") > Signed-off-by: Navid Emamdoost > --- > Changes in v3: > -- fix call to devm_kzalloc() > --- > drivers/media/platform/aspeed-video.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c > index eb12f3793062..70797b41447c 100644 > --- a/drivers/media/platform/aspeed-video.c > +++ b/drivers/media/platform/aspeed-video.c > @@ -1646,7 +1646,8 @@ static int aspeed_video_probe(struct platform_device *pdev) > { > int rc; > struct resource *res; > - struct aspeed_video *video = kzalloc(sizeof(*video), GFP_KERNEL); > + struct aspeed_video *video = > + devm_kzalloc(&pdev->dev, sizeof(*video), GFP_KERNEL); > > if (!video) > return -ENOMEM;