Message ID | 20240207134005.7515-1-pchelkin@ispras.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-56559-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2233818dyb; Wed, 7 Feb 2024 05:40:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBh7yf5YtEqf8wkNcBXWvF4O9LuOeCa0BANdOX+DGl5bYJzOxdq6IZVNbCKHuNV504or+1 X-Received: by 2002:a05:6122:219e:b0:4c0:3d69:5255 with SMTP id j30-20020a056122219e00b004c03d695255mr2912909vkd.11.1707313251256; Wed, 07 Feb 2024 05:40:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707313251; cv=pass; d=google.com; s=arc-20160816; b=wgOnxYHLt+yYEFEiS7x6Zo+LggV4jpDVQPUA6LC5poYwiTraczh8NQeWm9CUmANKFM HhEHqlDY32gJrUGYjaj67eeJsQlunFwgSuuzgakx2ntFRRHg7qCbKzZLBVLyIaID7yGj yK0oyKCFczKYbuxOHtbKes4fMiEpA3IXYqTq5xWML7q1XuyvaLKnG/Djd8jyKQZ7OKCQ xZWsot/oIlvbhULaapyn7L2XItbUBX7FBcigvcTw/GzQiUPsBvllF+/gY1IR3uBkWmXq lZ5c5cpKzJBHAj0NNHW8ZZ7exucQm2lN9N7top9yQb0DMSe11Fs2Pct1TRigwXZDOpNO Dh6A== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=oJI2plXYN0CmS62atrDcw/0YXz35BqxpvKCMr0u8TjE=; fh=UHG7lnSLiRXKNE9xHRwFupIIG0F12XFjHQxUUITUmSg=; b=LerjLfG/s37BxwZvzLAIfd+w4eAghUig6z1XR0z3FI0IHft8nzYzECHtr9/8Ym0YI5 Fk94y0OcyEe3Fmbe5qCB/Ms2WEPoGI7RLhcpqICprIsrkXiSbTX7t1Mq0TqcE2+66wuf 0HYwu3Fww48cHyGfTbAL12/1/iRH4eyeu56NHKkdsI8ugeWtpTs311mRSj9he/ePA2uI c2evaZge784cc4iBkuny2htnMMUNrFl5ZBbXox4P9vfTtcMCHGm/bwQ41n/RQMoLOOzR 7mcAyJXKJu13OEers38PWFxMHxLO8kkPSsfEJEy2p7iw6DCiug54+o0sEyr8uz8Ieatr b06Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b="dnS/pEGg"; 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-56559-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56559-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru X-Forwarded-Encrypted: i=2; AJvYcCWAe49NUh6N+/BRQthP+v0aksVpqIs5Y/RDcxyqsEQZj2TBxBMM5hXloLV6a8aUwwTjRUVv+8I+oDo9V4WYbmqEv6x5AA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dp12-20020a05621409cc00b0068cb4e29730si1085805qvb.129.2024.02.07.05.40.51 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 05:40:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56559-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b="dnS/pEGg"; 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-56559-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56559-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 03B7D1C22009 for <ouuuleilei@gmail.com>; Wed, 7 Feb 2024 13:40:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D59827A713; Wed, 7 Feb 2024 13:40:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="dnS/pEGg" 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 1177276C8F; Wed, 7 Feb 2024 13:40:24 +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=1707313228; cv=none; b=b/S+z4mWVh1T82Ve2yUEUSVy3+R2mW5/DittvhDCu2lEaTmuW/O4ticXkPYox5ZmubOMU0f+td9ugnu6xwP9gBmMdSEGqEw8bTL56QaszsBKstEPdN2LD6DXHVAsuwnAQUHOLZ2GiLW6DVAFSZv4aEQUGHy9tSNr1dUE41SdpFg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707313228; c=relaxed/simple; bh=KXP8XQgu1vPb7UIBRCAFbCn2XbWBSi9zlPgqvl9ob/Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HKVmc58tWiKp6qm3ZPcBjrcG0veBRNalmGLjmRKFGX/iHDaYkTk7ydA5k+Xoo5qlXtKtaZxhpvk0vVRha2DCUG6LmOOk/iv8NTeMKN3Q8P7ACeSc28wuLOPDv55U1jo9Ipyj0ZeXr7ZDILV11tQE25/bMA/LcX+5LWx72H26MHU= 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=dnS/pEGg; 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.6]) by mail.ispras.ru (Postfix) with ESMTPSA id 5CCFA40F1DEF; Wed, 7 Feb 2024 13:40:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 5CCFA40F1DEF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1707313222; bh=oJI2plXYN0CmS62atrDcw/0YXz35BqxpvKCMr0u8TjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dnS/pEGghnu4Oy0O9SuHkrzqgDeZ7i4KRaZNBOgqTCUn9dO2dcYdlm82QgxdXGc8K o828vcRrxI7O4ZgCVoqyFpO+b4RyfvABP6gxgZxUbcp9tMKvpQTRST+NUK8bwLEQbZ XEW14U6grY/0yQn1oj7PgPTPtteWDh9r202FoABA= 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, stable@vger.kernel.org Subject: [PATCH v2] bus: mhi: host: free buffer on error in mhi_alloc_bhie_table Date: Wed, 7 Feb 2024 16:40:05 +0300 Message-Id: <20240207134005.7515-1-pchelkin@ispras.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <2024020709-familiar-slapping-a96a@gregkh> References: 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: 1790247699747055756 |
Series |
[v2] bus: mhi: host: free buffer on error in mhi_alloc_bhie_table
|
|
Commit Message
Fedor Pchelkin
Feb. 7, 2024, 1:40 p.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")
Cc: stable@vger.kernel.org
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
---
v2: add missing Cc: stable, as Greg Kroah-Hartman's bot reported
drivers/bus/mhi/host/boot.c | 1 +
1 file changed, 1 insertion(+)
Comments
On 2/7/2024 6:40 AM, 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") > Cc: stable@vger.kernel.org > Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
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);