From: Takashi Iwai Subject: Re: [PATCH 1/4] ASoC: mc13783: Fix of_node_put() call with uninitialized object Date: Wed, 08 Oct 2014 07:28:52 +0200 Message-ID: References: <1412698794-25536-1-git-send-email-tiwai@suse.de> <1412698794-25536-2-git-send-email-tiwai@suse.de> <20141007170938.GM4609@sirena.org.uk> <20141007172337.GR4609@sirena.org.uk> <20141007180434.GU4609@sirena.org.uk> <20141007185443.GY4609@sirena.org.uk> <20141007230150.GO4609@sirena.org.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 80F522606DC for ; Wed, 8 Oct 2014 07:28:52 +0200 (CEST) In-Reply-To: <20141007230150.GO4609@sirena.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 8 Oct 2014 00:01:50 +0100, Mark Brown wrote: > > On Tue, Oct 07, 2014 at 08:58:38PM +0200, Takashi Iwai wrote: > > Mark Brown wrote: > > > > That looks ugly, yes - I'd be doing a check for ret before the second > > > property call or something. Or just put the pdata check in the existing > > > error path. > > > Well, I don't mind much how it'll be fixed, so I rather toss this fix > > to you. Feel free to cook :) > > Well, I can't even see the warning so as far as I can tell it's all > fixed! Oh, rather trust your eyes, the fault is there obviously. It's a real bug that can be easily triggered, not in an exceptional error path. BTW, putting pdata check in the exit path is more error-prone, as already mentioned. If anyone puts a new code with "goto out" before assignment of np, it hits again. So, a NULL initialization would be safer in the end. Takashi