Message ID | 20240207065136.18316-1-pchelkin@ispras.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-56034-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2044999dyb; Tue, 6 Feb 2024 22:52:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZ/oU9s6GzfM9A7m6+HDXe/KVPmhj0dP2N37qXHKKSHI81NbxoevdLHSPG0W9vHUufiEMP X-Received: by 2002:a25:83c2:0:b0:dc6:b0ce:97d with SMTP id v2-20020a2583c2000000b00dc6b0ce097dmr3864652ybm.29.1707288741522; Tue, 06 Feb 2024 22:52:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707288741; cv=pass; d=google.com; s=arc-20160816; b=KwkvvjhB6XFdUnBJ8Eqq7hmq66ttKlNQqHD1CMFC7VIW15US5ECkd0UUf4fCRDRJQN FIN9pA14TFPRNkcMDt1xufdwcLIjvI/KrGBcmAfgXe2QuZO6d/9cY6DopxPoY3XuCPbu m4v+oBOjspBqqvjPuhytIRJvGt40fkqg1M+5HAwjbhCfPB4AXSnATob3p1eGcJ/V4z8K Cz+J6QWnaJ5lSZKPcZVnx5zq2M4N9Jyp2biGiB2xiXG0eQ2kUOu1TsX+jd+hLpkogFxl XGqk1ykHz6TiBuvAiZXLwp4fnRY3f2Omo1Jvs3UoPrh4i1bHB8a8fGaT/n2b3SKMuGIH YCnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=pLGumPzf4SnkMMXOZxsu4fQpASfZpE+/MTtI3Z2JftY=; fh=pdv8Afc0TtNDruW3uA6MYjZNAZFWd+0Q20K2nZL6bNA=; b=G11xPayhc8B/sCW0mTI2VghqwnvB7l8xSvG1EqltcuLupueOi1/OHkNTjQagDhET07 F/oSJFqSXCH+Q2rVKF8RxNwNzHadhXdXSktShd6rcmhOiTPOYivmHEVhde0GDfXA0mJY 4ZHM3kmlYfMJdSiXbUBdWVof3h1STiNwWk7kFWIlYERTSGuI4/3LoD1dacNoUcHHqTU2 5VhdlHz+b7mcXBYOu4nJ7BghFqKM1zq1m2bxIHxvbomjTNOUffqnQzsZAYlNRZTSIgGU sadBjCD5peZBXVrvdW2bo2fBOQHUv+9qUTWnTa+2sDk6QmEWAFHm5Elo4mQx+iW07vVN zx+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=CkTAmr4S; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-56034-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56034-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru X-Forwarded-Encrypted: i=2; AJvYcCWW7zaI27TwMcM+NR+v+JMipjdlF1gxAJvCtAmfkO6Ca2bEOb8PzsKhah7aEvXE/t5UXeOojuzsGM7+z6/d/s5MfBz/DQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c22-20020a637256000000b005cf0309e41bsi818414pgn.823.2024.02.06.22.52.21 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 22:52:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56034-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=CkTAmr4S; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-56034-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56034-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 489F32862F4 for <ouuuleilei@gmail.com>; Wed, 7 Feb 2024 06:52:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4ED971F5F3; Wed, 7 Feb 2024 06:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="CkTAmr4S" Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 464901CF99; Wed, 7 Feb 2024 06:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707288720; cv=none; b=c2Y15W0IE6o+7QMUWPUSTg0GHjR/Zfu5er5ndlV6hPi6jDyrojBmc2IUdceKYePcersbitYqddMQH45RQQSlxTmQuc3qs5Xy4sfhi6s1OHxYtHhGuXQ9M9mnxtSwh+J228tJcCFHPJ6iyAgj+8ycNE9lE4xPGjDSwJvNpxvgM44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707288720; c=relaxed/simple; bh=xfJuk5EK3kY+kaejXnInyfN61eHdttxUa2l2rdBDTco=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=TjS1n55T+yfLmX4bTq0zZTH94spJM0svKOVyUDYWAlJLlKLS6zcOKlWm4n+3omo0wUcDobdfIRuPML1crprwwQ6orITxcyjCoiNUB/ssuOk8YKFXG3G/aum69gT8W+mgb6eIufiORiebLmc42psESMlED+YMSA+Tq/6Uky7MdRY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=CkTAmr4S; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Received: from fpc.intra.ispras.ru (unknown [10.10.165.5]) by mail.ispras.ru (Postfix) with ESMTPSA id 8FEBD4076729; Wed, 7 Feb 2024 06:51:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 8FEBD4076729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1707288709; bh=pLGumPzf4SnkMMXOZxsu4fQpASfZpE+/MTtI3Z2JftY=; h=From:To:Cc:Subject:Date:From; b=CkTAmr4SSItmwJIz7i0JJOF8It2sn5ADcCKXh6nsZdkDzt0hRJBDM0OEerEGNY6Ns 0xYSPX7fudoG0hxj6zctyd6JsTBskxtlMonpsSsIN/vzp1FDkD29pD5wCKRGfWLM4n K9lN0CCKxV0U46Fz80I9mYQCHvvDFS2Cv7JriuRY= From: Fedor Pchelkin <pchelkin@ispras.ru> To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Cc: Fedor Pchelkin <pchelkin@ispras.ru>, Jeffrey Hugo <quic_jhugo@quicinc.com>, Kalle Valo <quic_kvalo@quicinc.com>, Carl Vanderlip <quic_carlv@quicinc.com>, Sujeev Dias <sdias@codeaurora.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Siddartha Mohanadoss <smohanad@codeaurora.org>, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov <khoroshilov@ispras.ru>, lvc-project@linuxtesting.org Subject: [PATCH] bus: mhi: host: free buffer on error in mhi_alloc_bhie_table Date: Wed, 7 Feb 2024 09:51:36 +0300 Message-Id: <20240207065136.18316-1-pchelkin@ispras.ru> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790221999550395547 X-GMAIL-MSGID: 1790221999550395547 |
Series |
bus: mhi: host: free buffer on error in mhi_alloc_bhie_table
|
|
Commit Message
Fedor Pchelkin
Feb. 7, 2024, 6:51 a.m. UTC
img_info->mhi_buf should be freed on error path in mhi_alloc_bhie_table().
This error case is rare but still needs to be fixed.
Found by Linux Verification Center (linuxtesting.org).
Fixes: 3000f85b8f47 ("bus: mhi: core: Add support for basic PM operations")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
---
drivers/bus/mhi/host/boot.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Wed, Feb 07, 2024 at 09:51:36AM +0300, Fedor Pchelkin wrote: > img_info->mhi_buf should be freed on error path in mhi_alloc_bhie_table(). > This error case is rare but still needs to be fixed. > > Found by Linux Verification Center (linuxtesting.org). > > Fixes: 3000f85b8f47 ("bus: mhi: core: Add support for basic PM operations") > Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> > --- > drivers/bus/mhi/host/boot.c | 1 + > 1 file changed, 1 insertion(+) Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot
diff --git a/drivers/bus/mhi/host/boot.c b/drivers/bus/mhi/host/boot.c index edc0ec5a0933..738dcd11b66f 100644 --- a/drivers/bus/mhi/host/boot.c +++ b/drivers/bus/mhi/host/boot.c @@ -357,6 +357,7 @@ int mhi_alloc_bhie_table(struct mhi_controller *mhi_cntrl, for (--i, --mhi_buf; i >= 0; i--, mhi_buf--) dma_free_coherent(mhi_cntrl->cntrl_dev, mhi_buf->len, mhi_buf->buf, mhi_buf->dma_addr); + kfree(img_info->mhi_buf); error_alloc_mhi_buf: kfree(img_info);