Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754823AbbG3Hsy (ORCPT ); Thu, 30 Jul 2015 03:48:54 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44035 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751610AbbG3Hsv (ORCPT ); Thu, 30 Jul 2015 03:48:51 -0400 MIME-Version: 1.0 In-Reply-To: <1438201588-11018-1-git-send-email-vz@mleia.com> References: <1438201588-11018-1-git-send-email-vz@mleia.com> Date: Thu, 30 Jul 2015 03:48:49 -0400 Message-ID: Subject: Re: [PATCH] firmware: fix wrong memory deallocation in fw_add_devm_name() From: Ming Lei To: Vladimir Zapolskiy Cc: Greg Kroah-Hartman , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1127 Lines: 33 On Wed, Jul 29, 2015 at 4:26 PM, Vladimir Zapolskiy wrote: > Device resource data allocated with devres_alloc() must be deallocated > by devres_free(). > > Signed-off-by: Vladimir Zapolskiy Acked-by: Ming Lei > --- > drivers/base/firmware_class.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c > index 894bda1..8524450 100644 > --- a/drivers/base/firmware_class.c > +++ b/drivers/base/firmware_class.c > @@ -443,7 +443,7 @@ static int fw_add_devm_name(struct device *dev, const char *name) > return -ENOMEM; > fwn->name = kstrdup_const(name, GFP_KERNEL); > if (!fwn->name) { > - kfree(fwn); > + devres_free(fwn); > return -ENOMEM; > } > > -- > 2.1.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/