From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0139B208994 for ; Tue, 14 Jan 2025 19:56:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736884600; cv=none; b=Gl3EldU57CfV+tw9RCQDihN27G5ka6S8M38gDTSVcIOkAV/Cp8vkDseBz5yEpuER6klSMPiirPiH1HqdIpwo6V6tT1IXnZXXBohlHOfbn3IMV19o1s2Hn6rLyty/5bQWGRj4G/wLr0wlJgeZFgFlhGb3MMySvynnLvcKFveGSe0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736884600; c=relaxed/simple; bh=y/+EmGDA9oQh65FkQDBWgjTtUb9Q8LO/NWhu/sSSR2s=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Y7k32IcQ9LbMXeQgcK1HDXAvjVbaM3m86aVS3LDv3/yZbo11uIqmpJdizq6f87+ugmzjkDHR/U//zX52gltmhYkaNotvS4FdkVEb/m/o8VouCXNYINEfZ0BJ8WUCEN2gKycWyvejDFjlMWnKuvzm5prs6YJkXbhSBs1+K/TtA58= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Lwbg7obx; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Lwbg7obx" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-436345cc17bso42761515e9.0 for ; Tue, 14 Jan 2025 11:56:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736884597; x=1737489397; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=OmWlR4cF+mPlvD/SKofAb59V+xFfrfDkiiQN2ULLVu8=; b=Lwbg7obx6A9/bESQudinRz6qKVK+DOZJokUjGSNHcw6pSbb1XKY9YxyJH9+y+XOvHB JBzEEKp9jHf5xz12via0CbnxZ/3qWmS26D6g7KrZ+xle1sES4bPHKk1znJourdMeHZJg 5ypWAT6BVB4447KtyueqA1trXRfhWYMFbg+anGv6GyBwhaF1bIq75dbBcx33ROfMzhOW OIVOIyJMQtSLt+8aTS0HJ3XWW5ByAkc5dGb6/fqAl4r6ow7ri2JQ1wqGhOzMLoOaAih7 DQW6cE0y76hJ/3yoy/4thiqSq3bs2PG5OlZiXz8m6LlE5s578LSqKJ/wjAux+5p+YIfz vScw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736884597; x=1737489397; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=OmWlR4cF+mPlvD/SKofAb59V+xFfrfDkiiQN2ULLVu8=; b=UP+RLFtlx/+UVTp5fX79iLNmYb0/c8Xd7ihUcM+Ho5zF3dXtHbu+BT/8CEhXc3Zehv BwkvsieJKNlHKN+PvehjXxq2sbnX4y5FMPlQxNofREBP9lyXa+nbm+QNpfXlt6PqgKK8 q1+ZDUlwPtn1mDE8HCeZapyLkYTv7moO7TKkYw3Jz5qOtFFKUotmQbg1DI9n2ilOdAIV Xmy+M6hGqhpFqwrgNeWSBfceM7sAwaOhKBmMo0UpyMDhaqFvrja3Xel0yYHKnYXb+ROG i6Z5GamaJJwx7LkeoL7KChbnER6Fei7tUXdvciDU/UIonNmoN0iOmQWQo6fY8+V6mkVC ah8Q== X-Forwarded-Encrypted: i=1; AJvYcCXaO15ZL1Hq645TpI83oh1t+gi/R1wtYVpfdVnRMhA7X8+3X9+QYBaPdgYZWH2/wxZmlVinDKl+e87DFWs=@vger.kernel.org X-Gm-Message-State: AOJu0YzhyqdDzDibWip9krLigM7If/WwcuJc6nC9Zj3UQ/eSj3cdQqR/ lL2/cvhfemWidGrdbhfR0CHmann1f9Q2m/8JcEPvQc0PIZrrlHdPvdM1MyFXTwg= X-Gm-Gg: ASbGncvCgKlfq10yBM/sDvTtOdSq1OXOJ4nIll+xdTQsUilcyld66E9ZHZbpYnbSsnk 0dZ84T7FDZh7HdHk+KS5niDT0cSqyq/jmSXZji1BBEXUHMuU4e5txw12kRCKPu6Etj7Eu4G2swf wFmjGq5kbDFhGkYfd1JaEuhgb+HhY+6c9n0u7tEbAVMVYDHhEZiPXeUQHvn4CbhpQz25pnK7hpn j3z02Q4jB6LUqugX/j7fM+lpJRc+xOOp1RlPr8eiXGc4JPzMZ86/3IWEoXe X-Google-Smtp-Source: AGHT+IGQouXUOO+qEb5G2vSRcAAdIKYNRk9bOvvSttjkX7QyY7z4FXFdlG3d/Ksq2SBLmY2mxOAH8w== X-Received: by 2002:a05:6000:1f88:b0:38a:615c:8223 with SMTP id ffacd0b85a97d-38a872f69c7mr22826797f8f.10.1736884597362; Tue, 14 Jan 2025 11:56:37 -0800 (PST) Received: from draszik.lan ([80.111.64.44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bddbf50a2sm5275313f8f.43.2025.01.14.11.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 11:56:36 -0800 (PST) Message-ID: <13a3fdb675baa36fcda1bb254b05032b1175a2a8.camel@linaro.org> Subject: Re: [PATCH v2] scsi: ufs: fix use-after free in init error and remove paths From: =?ISO-8859-1?Q?Andr=E9?= Draszik To: Bart Van Assche , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Peter Griffin , Krzysztof Kozlowski , Manivannan Sadhasivam , Eric Biggers Cc: Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, stable@vger.kernel.org Date: Tue, 14 Jan 2025 19:56:35 +0000 In-Reply-To: <58f1b701-68da-49c0-b2b1-e079bad4cd08@acm.org> References: <20250114-ufshcd-fix-v2-1-2dc627590a4a@linaro.org> <58f1b701-68da-49c0-b2b1-e079bad4cd08@acm.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.1-4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi Bart, On Tue, 2025-01-14 at 09:55 -0800, Bart Van Assche wrote: > On 1/14/25 8:16 AM, Andr=C3=A9 Draszik wrote: > > +/** > > + * ufshcd_scsi_host_put_callback - deallocate underlying Scsi_Host and > > + * =C2=A0=C2=A0 thereby the Host Bus Adapter (HBA) > > + * @host: pointer to SCSI host > > + */ > > +static void ufshcd_scsi_host_put_callback(void *host) > > +{ > > + scsi_host_put(host); > > +} >=20 > Please rename ufshcd_scsi_host_put_callback() such that the function=20 > name makes clear when this function is called instead of what the=20 > function does. Would you have a suggestion for such a name? Something like ufshcd_driver_release_action()? Unless I'm misunderstanding you, I believe most drivers use a function name that says what the function does, e.g. dell_wmi_ddv_debugfs_remove (just as a completely random example out of many). If going by when it is called and if applying this principle throughout ufshcd, then there can only ever be one such function in ufshcd, as all devm_add_action() callback actions happen at driver release, which surely isn't what you mean. You probably meant something different? Cheers, Andre'