From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E54AC63797 for ; Wed, 4 Jan 2023 16:13:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239731AbjADQN0 (ORCPT ); Wed, 4 Jan 2023 11:13:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239866AbjADQMw (ORCPT ); Wed, 4 Jan 2023 11:12:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3ADDDE4 for ; Wed, 4 Jan 2023 08:12:51 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6A5ACB81732 for ; Wed, 4 Jan 2023 16:12:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8956CC433F1; Wed, 4 Jan 2023 16:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672848769; bh=jsCTJlqLyIy20TAjZal62lzOYgk+2R8QE9cZ0NxVE1U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RixBqyguCXakwUI67erIffSiXrZOU+hcW8NF7C1S+11h47KL3HFNFu1/Mmyiwcs1o 74nL4ODYv+ogwfFFEPCcJcjV7gnYLl5u/eayHRSvjTFGEJly/kS5J0ycmr4vX7oy2B VGcmtTeuHZrGyOhVnwyFzZeJduyjpupVgbkq8bON3nhe3X/0UuhdbhZuMMHZcyOnic /J0Yq+YRCvNg6rmAVj2iHgSwsJ+E/xQQaB1e/dip74U6wGCjDG7W1NQHEWjSiiwlEr 3C6wXenjJ9wr6TalMO9Fmxgh82encxzqz0LkyiJKsUnJF1JbnuCglRS0FI3NWoXQPJ KTtAC9V4HjRww== Date: Wed, 4 Jan 2023 16:12:43 +0000 From: Lee Jones To: Qiheng Lin Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd: pcf50633-adc: Fix potential memleak in pcf50633_adc_async_read() Message-ID: References: <20221208061555.8776-1-linqiheng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221208061555.8776-1-linqiheng@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 08 Dec 2022, Qiheng Lin wrote: > `req` is allocated in pcf50633_adc_async_read(), but > adc_enqueue_request() could fail to insert the `req` into queue. > We need to check the return value and free it in the case of failure. > > Fixes: 08c3e06a5eb2 ("mfd: PCF50633 adc driver") > Signed-off-by: Qiheng Lin > --- > drivers/mfd/pcf50633-adc.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) Applied, thanks -- Lee Jones [李琼斯]