All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Yang Xiuwei <yangxiuwei@kylinos.cn>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, Ming Lei <ming.lei@redhat.com>,
	Bart Van Assche <bvanassche@acm.org>,
	John Garry <john.g.garry@oracle.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v3] scsi: sd: fix missing put_disk() when device_add(&disk_dev) fails
Date: Wed, 08 Apr 2026 22:11:35 -0400	[thread overview]
Message-ID: <yq1mrzcyjap.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20260330014952.152776-1-yangxiuwei@kylinos.cn> (Yang Xiuwei's message of "Mon, 30 Mar 2026 09:49:52 +0800")


Yang,

> If device_add(&sdkp->disk_dev) fails, put_device() runs
> scsi_disk_release(), which frees the scsi_disk but leaves the gendisk
> referenced. The device_add_disk() error path in sd_probe() calls
> put_disk(gd); call put_disk(gd) here to mirror that cleanup.

Applied to 7.1/scsi-staging, thanks!

-- 
Martin K. Petersen

  parent reply	other threads:[~2026-04-09  2:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  1:49 [PATCH v3] scsi: sd: fix missing put_disk() when device_add(&disk_dev) fails Yang Xiuwei
2026-03-30  2:12 ` Ming Lei
2026-03-30  3:06   ` Yang Xiuwei
2026-04-09  2:11 ` Martin K. Petersen [this message]
2026-04-14  2:19 ` Martin K. Petersen

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=yq1mrzcyjap.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=bvanassche@acm.org \
    --cc=john.g.garry@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=stable@vger.kernel.org \
    --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 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.