Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752772AbcDNWSW (ORCPT ); Thu, 14 Apr 2016 18:18:22 -0400 Received: from lists.s-osg.org ([54.187.51.154]:32780 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752602AbcDNWSU (ORCPT ); Thu, 14 Apr 2016 18:18:20 -0400 Reply-To: shuah.kh@samsung.com Subject: Re: [PATCH] media: saa7134 fix media_dev alloc error path to not free when alloc fails References: <1460651480-6935-1-git-send-email-shuahkh@osg.samsung.com> <20160414180858.43c8620b@recife.lan> To: Mauro Carvalho Chehab , Shuah Khan Cc: nenggun.kim@samsung.com, akpm@linux-foundation.org, jh1009.sung@samsung.com, inki.dae@samsung.com, arnd@arndb.de, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org From: Shuah Khan Message-ID: <57101729.1030909@samsung.com> Date: Thu, 14 Apr 2016 16:18:17 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160414180858.43c8620b@recife.lan> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 705 Lines: 28 On 04/14/2016 03:08 PM, Mauro Carvalho Chehab wrote: > Em Thu, 14 Apr 2016 10:31:20 -0600 > Shuah Khan escreveu: > >> media_dev alloc error path does kfree when alloc fails. Fix it to not call >> kfree when media_dev alloc fails. > > No need. kfree(NULL) is OK. Agreed. > > Adding a label inside a conditional block is ugly. In this case, if label is in normal path, we will see defined, but not used warnings when condition isn't defined. We seem to have many such cases for CONFIG_MEDIA_CONTROLLER :( thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America(Silicon Valley) shuah.kh@samsung.com | (970) 217-8978