Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6241564ybe; Tue, 17 Sep 2019 23:39:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzN+q4N31slZohUfGeUItgrJIH7M6SX2Y7jMaX/fQTvfhqFmNh1gSHQgjYL8T2mBtQ5wflQ X-Received: by 2002:a50:8a9d:: with SMTP id j29mr8789356edj.283.1568788764858; Tue, 17 Sep 2019 23:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568788764; cv=none; d=google.com; s=arc-20160816; b=wCb1r3WAiW4NDCRGlKCSYPPD6S7CvK+zfwn/lf9gqF4HViy0UqWRS/6EyiOJyseAV2 TLFkoFlYPCPSk0/epxx2Pu2xG+Y424mpE5MFrb/GzHosoFBCq5R38K57vomtkCesYHwR PD6xiqITifE4yJ8wKTiug0ZvtWjxMVAGxANI25AkAEsnToEKYxQsj0b2bQaHjHvaklGa 6k+DwUHxKr3AWmrIAISPqWPrbQAb08MsZpKhTpeuSBGkcaee8n+BDyKNa6uy4jm5LPRE wujdUqSIj2txIsp63wtjqoupxyGKDUcPJxbXIINWF0u+DS4MAwLOX9JdBn3Jwe2j4WCj BOkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7hTH+QZ0Rg1J8IDO+1UiOPyFh3Jvo6QqRltmoWe2MW4=; b=AVBXitiXZZn+YE5DQ/DN1RJ+N0JFIE6wu4pvjlitjEKa6VOcn6DEUP7JVktNLfP01/ jymsl0VjKjEs2EM95iDwIkkX8EOIZV3zLhGOkb/6TMIBRXmUlqZBHAqK9oasx4gwDJV2 PIRyASvPPXMaeSwdw7LaAD+BkTLk66F3fqTpAyERRt84ABjp1pkQbkgO84leH3lLLh+d RpneNby9gzo23kAVB/vUGSXVyyCGiW7uTC4tHq+u1ADRaZ5UUwsb0cC+78YkQgvacKs1 IqcsijGcpi5wZBWSA3tTfnKd/EXBpedsqnr1rhxUHbl8LFH7q259BeGlpr/kvn1vt0xy 4agA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X0g3AnbC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si2248004ejf.133.2019.09.17.23.39.01; Tue, 17 Sep 2019 23:39:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X0g3AnbC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729134AbfIRGeH (ORCPT + 99 others); Wed, 18 Sep 2019 02:34:07 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45035 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbfIRGeH (ORCPT ); Wed, 18 Sep 2019 02:34:07 -0400 Received: by mail-pf1-f196.google.com with SMTP id q21so3667747pfn.11 for ; Tue, 17 Sep 2019 23:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7hTH+QZ0Rg1J8IDO+1UiOPyFh3Jvo6QqRltmoWe2MW4=; b=X0g3AnbCKw+4TwyXRilD5SoauIs7wFaCMcwJKFXFr+zMxnDhMe2h8FvUT7Uilb0cyQ rOHGkNZRi46MCx5F3tyS4fy75friu9ruEtFpKh0Z2S6tWdUkZx4uLAeBKh4xjqoxzzut G81E4cQU5C8fHwDxi0SovdBNlntxF3QSRCx+VA6snwPzZXgabK/h0b2LIylAYFPIKd47 JWy1+Eyc3nQWc3YU6i5tTx4u3XuZVT0CYgFy7OpgYJpZi0MtU3J1bN49gsY96lzLHLk9 z5THRSdFErwm8GSn5Xt6MaUpUggMzlOHC/DVjWGjGE6c61eUSrIhwQ5edcmv5qO4QayY wi/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7hTH+QZ0Rg1J8IDO+1UiOPyFh3Jvo6QqRltmoWe2MW4=; b=I8y9mPzYw1elcOQRxHb6tA83X2hjN71jOAfjIeDenAnQyU0f2paP2u0nAozpRHndwL Y6UfyWbkV83m09X28GI9dujAILKQirfPXX/7N3WG/EZPSg/hmFh6QfBrBKmf7nel8Va4 e107cL9GdKlZHE8Wc12ZLEioPkbdJ1yRsQQcQnq1IfdJUPL4QypcdkQtEFEZ41uzZJ67 K1yvceHYBDRqNqlFW917aoWih0wB25vLOkRaAcJqSTHrO1DKurcBKsnmAAsfRN+PMRCo 3zlD9xJxxisXqlWnrUhRjxoIuPLiBvpQFG5VRpyiWsPOueGZmtyqnKP6aimOidmtSOud LzPw== X-Gm-Message-State: APjAAAVzx5QwWiaq9g9aBq4sxSS4IbUIPplx+E2uTEpyvO+x22HkTb+h H+T6XLQ52KRzN1ZttAd1I0DmjmVT75A= X-Received: by 2002:aa7:8dcf:: with SMTP id j15mr2449689pfr.5.1568788446445; Tue, 17 Sep 2019 23:34:06 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id y28sm7614921pfq.48.2019.09.17.23.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 23:34:05 -0700 (PDT) Date: Tue, 17 Sep 2019 23:34:03 -0700 From: Bjorn Andersson To: Jorge Ramirez-Ortiz Cc: gregkh@linuxfoundation.org, arnd@arndb.de, srinivas.kandagatla@linaro.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 2/5] misc: fastrpc: fix memory leak from miscdev->name Message-ID: <20190918063403.GD1636@tuxbook-pro> References: <20190913152532.24484-1-jorge.ramirez-ortiz@linaro.org> <20190913152532.24484-3-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190913152532.24484-3-jorge.ramirez-ortiz@linaro.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 13 Sep 08:25 PDT 2019, Jorge Ramirez-Ortiz wrote: > From: Srinivas Kandagatla > > Fix a memory leak in miscdev->name by using devm_variant > > Orignally reported by kmemleak: > [] kmemleak_alloc+0x50/0x84 > [] __kmalloc_track_caller+0xe8/0x168 > [] kvasprintf+0x78/0x100 > [] kasprintf+0x50/0x74 > [] fastrpc_rpmsg_probe+0xd8/0x20c > [] rpmsg_dev_probe+0xa8/0x148 > [] really_probe+0x208/0x248 > [] driver_probe_device+0x98/0xc0 > [] __device_attach_driver+0x9c/0xac > [] bus_for_each_drv+0x60/0x8c > [] __device_attach+0x8c/0x100 > [] device_initial_probe+0x20/0x28 > [] bus_probe_device+0x34/0x7c > [] device_add+0x420/0x498 > [] device_register+0x24/0x2c > Cc: stable@vger.kernel.org Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model") > Signed-off-by: Srinivas Kandagatla You should append your S-o-b here, as you forwarded the patch. Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/misc/fastrpc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c > index 8903388993d3..bc03500bfe60 100644 > --- a/drivers/misc/fastrpc.c > +++ b/drivers/misc/fastrpc.c > @@ -1599,8 +1599,8 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) > } > > data->miscdev.minor = MISC_DYNAMIC_MINOR; > - data->miscdev.name = kasprintf(GFP_KERNEL, "fastrpc-%s", > - domains[domain_id]); > + data->miscdev.name = devm_kasprintf(rdev, GFP_KERNEL, "fastrpc-%s", > + domains[domain_id]); > data->miscdev.fops = &fastrpc_fops; > err = misc_register(&data->miscdev); > if (err) > -- > 2.23.0 >