Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Yang Xiuwei <yangxiuwei@kylinos.cn>
Cc: James.Bottomley@HansenPartnership.com, hare@suse.de,
	linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
	p.raghav@samsung.com, sw.prabhu6@gmail.com,
	tom.leiming@gmail.com
Subject: Re: [PATCH v1 2/4] scsi: sd: unify sd_probe() error cleanup through out_put
Date: Mon, 29 Jun 2026 14:03:03 +0900	[thread overview]
Message-ID: <0f973be4-aa0d-435c-82f1-edd3925cc926@kernel.org> (raw)
In-Reply-To: <20260629011653.2238665-1-yangxiuwei@kylinos.cn>

On 6/29/26 10:16 AM, Yang Xiuwei wrote:
> ---
> 
> Hi Damien,
> 
> On Sat, Jun 27, 2026 at 06:54:44AM +0900, Damien Le Moal wrote:
>> device_unregister() is called here and in the next error path too. So what about
>> a "goto out_unregister;" to avoid repeating this pattern ?
> 
> I tried that too, but out_unregister cannot fall through to out_free_index:
> scsi_disk_release() already calls ida_free(). So it needs a second
> goto out_put after unregister, which is why v1 kept the explicit paths.

Simple solution is best :) If changing the labels makes things more
complicated, then please feel free to ignore my comment.


-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2026-06-29  5:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 10:01 [PATCH v1 0/4] scsi: sd: fix probe error cleanup, special_vec leak and sd_done() sense gate Yang Xiuwei
2026-06-23 10:01 ` [PATCH v1 1/4] scsi: sd: fix error handling in sd_probe() after large pool creation failure Yang Xiuwei
2026-06-26 21:52   ` Damien Le Moal
2026-06-23 10:01 ` [PATCH v1 2/4] scsi: sd: unify sd_probe() error cleanup through out_put Yang Xiuwei
2026-06-26 21:54   ` Damien Le Moal
2026-06-29  1:16     ` Yang Xiuwei
2026-06-29  5:03       ` Damien Le Moal [this message]
2026-06-23 10:01 ` [PATCH v1 3/4] scsi: sd: fix special_vec mempool leak when scsi_alloc_sgtables() fails Yang Xiuwei
2026-06-23 10:20   ` sashiko-bot
2026-06-26 21:57   ` Damien Le Moal
2026-06-23 10:01 ` [PATCH v1 4/4] scsi: sd: fix sd_done() sense handling condition Yang Xiuwei
2026-06-23 10:18   ` sashiko-bot
2026-06-26 22:07   ` Damien Le Moal

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=0f973be4-aa0d-435c-82f1-edd3925cc926@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=p.raghav@samsung.com \
    --cc=sw.prabhu6@gmail.com \
    --cc=tom.leiming@gmail.com \
    --cc=yangxiuwei@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox