Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp484895rdh; Wed, 7 Feb 2024 10:15:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXzZiLkKy4UgT7PrHFNSujpajSKERjBGSRdvUiQ1wkIYphph2DtQCFljCJyIuJ0cNuMZmr/JgbjEXQA0S6CP0wD7fQnXhkAfqVR2W/MSQ== X-Google-Smtp-Source: AGHT+IFPWPdI+ShUko3RTBSzWeejRuXx8OXQU+wzvLtgA71VF7tjtQDoWu2j32hAtWXrSAivnMTk X-Received: by 2002:a50:aa96:0:b0:55f:ccb4:ec84 with SMTP id q22-20020a50aa96000000b0055fccb4ec84mr333306edc.1.1707329725066; Wed, 07 Feb 2024 10:15:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707329725; cv=pass; d=google.com; s=arc-20160816; b=DorIF+N6FzdWAyBLH2bPZLoGpuNYLKQsf46iCyaqMfgdjbESDH3k54aiMDAbtI1viJ U53RLszcft8ZFfss+yFV5twlKoj/c0Ldx/e1TYZkd+FaLTgRWIT4Z/s1e3oc3rVwXY5Y WeIckezrkZN8ZtdGmdEtODiE+G6NK8fDAmu0jCkisCUaH4fMDjhHipoBbgAZgjlVfkbo k3rUcQcj3/wHCk9hiTEA3e6UZRJ47AvRXQ1PfS02gnv/WlCI1+r93lPZqyWaE9jOIhNA mY1Iu3uxyQNJI6QGvhTrzLxbmkt/bkvL5rJMtqv8W7XZazUu10uKyFVG6m1WDEy3FvX+ k4lw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=VRwwrWgHIcGNWJXD2OwHm/m6fXi9xzKbfg18D7NF6nI=; fh=OzNFzHuzkBBj/aTUZMQKb7Up1U6m4CYDGZbcpe+ERB8=; b=ecHNUBx4zAADVfS1r52XL2obMYj9TxYYde1AqrDV83bkk/2D4EU6rOnsIYvgeihBsP PUuBRPm0oYxoDFOBPb7oPLSnaYeeR4sUeKcQ5oSgR4LeqtWKnUyCVR9pcdcty/S82Vai U8fbvJ7ISTqhs46MgeDeHltpFkPvGber5wRty3/blImm2HSmFTrW2whlksYh7iLb7Oes sA58HR5xlWL8kVfep/JAIijoLfvcCoYwMtcxx9FSXOKunlnvWMVSYjuKng8b4t68BlR/ 452vUJHsQUm+xWyV9/e+l6KYkJhJF2GH3s/Vcc1UmEjPAUHuUQ0gEiicY/KS2zjzWHDl DAQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cHpzZGOe; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-56895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56895-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCVoJ0TyS3wo5LMdPzBdjhP9Dqrg5S02YOs+YeTrHE1v1RcTkVAXtBverUWVr27Z3e7qUY5pPJV3gWcXVoH1pKpdfMWDGF7pO6W6HHhUzw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m7-20020a50ef07000000b0055ffe188f9bsi1139956eds.26.2024.02.07.10.15.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 10:15:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cHpzZGOe; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-56895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56895-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id CAA231F28C1D for ; Wed, 7 Feb 2024 18:15:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCB6385644; Wed, 7 Feb 2024 18:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="cHpzZGOe" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53A7E83CD2; Wed, 7 Feb 2024 18:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707329402; cv=none; b=WM8MDSSkCL5KXvz2k5MW1Sbyx+xAY4Z9dSG0l1WNjLNoBP8WWfGc04HsQxo91T6GHUFsaUpgkJbwLjYUPqA6tzAqP6cDN3NXes0Q9Mnk+8pw4PKKb1Uz9QE60liwMR6O7k3ICzHziZBS2a+yeDgyoUz2sUvuo19q1z4XA8XX4CM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707329402; c=relaxed/simple; bh=PZhwfw3yFoBnmTr5KEskYLgTZtjV2a5wBbQGa0szcWA=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=tbr76eMgEpfWfelUAMyZoMJNoBa8wR6LV4QmItPqjIXaqvsUoa/X6nNF7pRaCYcz5Be84bfgkwc36RyHOyO//i8axMLTNzjIOWwPhYY65aR5tuSUbrQj8obLgc0HPRfY1aTrNNbSasM/iYKOr4e08KpEfZLjCd2pSfewAwHQYUY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=cHpzZGOe; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 417GixPD004624; Wed, 7 Feb 2024 18:09:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=VRwwrWgHIcGNWJXD2OwHm/m6fXi9xzKbfg18D7NF6nI=; b=cH pzZGOe2yWgX4wM9d9QOSAQ9hVZfponNfCuEF6cUksSdzxyG65zvBsfBXCKo/19hG 2vHm4WWWb3buUq2CihCGUIWo1pm/2ls99IRL8rKG+MZ2eV7mT9heu2jUJ4DIdfWi yoOXpjexYhhPU6977o2P8kcGpTibUAkM3C/DEhKR+YiPAtzCoizmhoFOKQcCbMxT m/9WGbz7BqbgtOCx+ijqL+rZG3AAjIeDg6rmV1riOQnQSXi01PUe4n4akdVpczSQ NdwRgouaXHihYuDizUaKF9VvY2CoJu1u/B3UmPM7zayKpmVL+olm0pzY0ipwnBmu d5SKvEViZHs65w5lG6iw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w3x41t41q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Feb 2024 18:09:04 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 417I93r7011560 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Feb 2024 18:09:03 GMT Received: from [10.226.59.182] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 7 Feb 2024 10:09:02 -0800 Message-ID: <883d5c25-e607-bfe7-1fc1-cad86e828be6@quicinc.com> Date: Wed, 7 Feb 2024 11:09:01 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v2] bus: mhi: host: free buffer on error in mhi_alloc_bhie_table Content-Language: en-US To: Fedor Pchelkin , Manivannan Sadhasivam CC: Kalle Valo , Carl Vanderlip , Sujeev Dias , "Greg Kroah-Hartman" , Siddartha Mohanadoss , , , , "Alexey Khoroshilov" , , References: <20240207134005.7515-1-pchelkin@ispras.ru> From: Jeffrey Hugo In-Reply-To: <20240207134005.7515-1-pchelkin@ispras.ru> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: TGyWmJChje4FlG2rHaPHG3yk2Tldqovb X-Proofpoint-GUID: TGyWmJChje4FlG2rHaPHG3yk2Tldqovb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-07_09,2024-02-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 mlxlogscore=685 clxscore=1011 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402070134 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 Reviewed-by: Jeffrey Hugo