Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2377123pxk; Sun, 27 Sep 2020 05:28:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWZR/Cv3Sj3KUE0/r3Iqm/g5gU5JPhSB1sNSKJX+hIV+7uyfCcNL2OWdZS4aNQIr9YFRh7 X-Received: by 2002:a50:8fa3:: with SMTP id y32mr11120374edy.78.1601209729469; Sun, 27 Sep 2020 05:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601209729; cv=none; d=google.com; s=arc-20160816; b=wMl0dKK0gykf4GsRSDnEdxMde6xnIQkllpYQr0uCVNaZ7HOEQkzy5VzWGKFOmutDw0 BBdqXCrHqWrHqcEBtl5HWfG8O75V9gBu0XkXzuZPYWk58z1bqZ8xNllf/DLwiYkGNRoN WKInUhV9H6qDb+4ioKEFn/RkoBztVY/tRC4bGD/TrICfsrOm0OfUIvNm3LGi0GgfyxNf AlbwHKUWJWyQqMj67B2oqAyOM6e7RQ3u9ta1K9oJulDEtNU9lpo6k5Y7TR5NtD4B0kDB Z1F8nHLXaTLi7muxMvoDN2qqi1vzErNZAItZuSwrWgvK5qgsnP0fhPX0Cs3TNPmdDfTt Ih8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vGBtDtYv+9mSgkY/liRjtsnEcz7Z2XN5PzLfb43nwTc=; b=A0v55WVBVWQt96STEjkHKr2vyaDqXJomwsQmPWeXof4ElS7k5YueqeFHhsmaMBrLou sFoysTEZD/LX9m9jSCzTm5TxxkYfBsCGgEMQ0mLx7QiSCUUVb9KmWkxCn2m+b2vlMfVe Kjk/vbEMP6qKQjjaizggEnpkGkUU7u0iU7Td+6mAi0TM22EYI3//YWDaTL3VCq3ZjXJz yUoDNiED/Vi1WdLguNdkp0wsXmv74LgbiVzAjhjKBRwwrpFaIVPwM5LbM0DkP7eCcvdP sycMRnD9cdTx5TaJZbH3W54KLdnC0zkNN74jOdvED9ZgMch6xA8o/FTwiwdWhg9Oflrl Oyww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wKm0mWRV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v27si6434231edi.305.2020.09.27.05.28.26; Sun, 27 Sep 2020 05:28:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wKm0mWRV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726597AbgI0MZI (ORCPT + 99 others); Sun, 27 Sep 2020 08:25:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:37808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726328AbgI0MZI (ORCPT ); Sun, 27 Sep 2020 08:25:08 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 317A723718; Sun, 27 Sep 2020 12:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601209507; bh=IY/N4/ki8QJZ9vdRwB7Eus2b1ptin2/9EGBJa2l8EbY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wKm0mWRV+6ARVxIfY4vm2CJU32hbHecxSvUSR81Yh9pkW7vpX4+FoF5b/3lUa/qwO YeB/uIfp1P5Uj8s2h2OOFB/DM+ciqibvsE52+Bh20TQXuXQWfepFotLOV1Px8lALdR DbKRxNKrZu4+wp4mrgnawtfkO67W+FKhN7H1kMM4= Date: Sun, 27 Sep 2020 14:25:16 +0200 From: Greg Kroah-Hartman To: Srinivas Kandagatla Cc: Vadym Kochan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] nvmem: core: fix possibly memleak when use nvmem_cell_info_to_nvmem_cell() Message-ID: <20200927122516.GB179084@kroah.com> References: <20200923204456.14032-1-vadym.kochan@plvision.eu> <12edae35-a927-11bf-f80a-037011c4f07a@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12edae35-a927-11bf-f80a-037011c4f07a@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 25, 2020 at 10:32:42AM +0100, Srinivas Kandagatla wrote: > > > On 23/09/2020 21:44, Vadym Kochan wrote: > > Fix missing 'kfree_const(cell->name)' when call to > > nvmem_cell_info_to_nvmem_cell() in several places: > > > > * after nvmem_cell_info_to_nvmem_cell() failed during > > nvmem_add_cells() > > > > * during nvmem_device_cell_{read,write} when cell->name is > > kstrdup'ed() without calling kfree_const() at the end, but > > really there is no reason to do that 'dup, because the cell > > instance is allocated on the stack for some short period to be > > read/write without exposing it to the caller. > > > > So the new nvmem_cell_info_to_nvmem_cell_nodup() helper is introduced > > which is used to convert cell_info -> cell without name duplication as > > a lighweight version of nvmem_cell_info_to_nvmem_cell(). > > > > Fixes: e2a5402ec7c6 ("nvmem: Add nvmem_device based consumer apis.") > > Signed-off-by: Vadym Kochan > > Looks good to me! Thanks for the patch. > > Reviewed-by: Srinivas Kandagatla > Acked-by: Srinivas Kandagatla > > Greg, > > Can you please pick this one? As don't have any nvmem pending patches to > send it together. Will do, thanks. greg k-h