All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hongling Zeng <zhongling0719@126.com>
To: Hongling Zeng <zenghongling@kylinos.cn>,
	Kai.Makisara@kolumbus.fi,  James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com,  djeffery@redhat.com,
	jmeneghi@redhat.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: st: Fix lock leak in st_ioctl()
Date: Wed, 20 May 2026 15:52:05 +0800	[thread overview]
Message-ID: <6A0D6825.8050902@126.com> (raw)
In-Reply-To: <20260520074016.51975-1-zenghongling@kylinos.cn>

   Hi,

   Please ignore my previous patch: [PATCH] scsi: st: Fix lock leak in 
st_ioctl()

   The original code is correct. st_common_ioctl() releases &STp->lock
   internally, so there is no lock leak. This is a false  positive.

   Sorry for the noise.

   Regards,
   Hongling

在 2026年05月20日 15:40, Hongling Zeng 写道:
> The default case in the switch statement returns directly from
> st_common_ioctl() without releasing &STp->lock, causing a lock
> imbalance. Fix by jumping to the out label to properly release
> the lock.
>
> Fixes: b37d70c0df85 ("scsi: st: Separate st-unique ioctl handling from SCSI common ioctl handling")
> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
> ---
>   drivers/scsi/st.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
> index f1c3c4946637..3b08992e1b10 100644
> --- a/drivers/scsi/st.c
> +++ b/drivers/scsi/st.c
> @@ -3628,7 +3628,8 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
>   	case MTIOCTOP:
>   		break;
>   	default:
> -		return st_common_ioctl(STp, STm, file, cmd_in, arg);
> +		retval = st_common_ioctl(STp, STm, file, cmd_in, arg);
> +		goto out;
>   	}
>   
>   	cmd_type = _IOC_TYPE(cmd_in);


  reply	other threads:[~2026-05-20  7:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20  7:40 [PATCH] scsi: st: Fix lock leak in st_ioctl() Hongling Zeng
2026-05-20  7:52 ` Hongling Zeng [this message]
2026-05-20 16:25   ` Bart Van Assche
  -- strict thread matches above, loose matches on Subject: below --
2026-06-03  7:11 Hongling Zeng
2026-06-03  7:16 ` Hongling Zeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6A0D6825.8050902@126.com \
    --to=zhongling0719@126.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Kai.Makisara@kolumbus.fi \
    --cc=djeffery@redhat.com \
    --cc=jmeneghi@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=zenghongling@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.