From: Matthew Wilcox <matthew@wil.cx>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Hannes Reinecke <hare@suse.de>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>,
SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [Patch] Fix oops on rmmod usb-storage
Date: Wed, 29 Sep 2004 16:28:34 +0100 [thread overview]
Message-ID: <20040929152834.GH16153@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <1096470919.1762.21.camel@mulgrave>
On Wed, Sep 29, 2004 at 11:15:13AM -0400, James Bottomley wrote:
> struct scsi_cmnd *scsi_get_command(struct scsi_device *dev, int gfp_mask)
> {
> - struct scsi_cmnd *cmd = __scsi_get_command(dev->host, gfp_mask);
> + struct scsi_cmnd *cmd;
> +
> + /* Bail if we can't get a reference to the device */
> + if (!get_device(&dev->sdev_gendev))
> + return NULL;
How can this happen? You're taking the address of dev->sdev_gendev, so it
can't be NULL:
struct device * get_device(struct device * dev)
{
return dev ? to_dev(kobject_get(&dev->kobj)) : NULL;
}
(kobject_get returns its argument).
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
next prev parent reply other threads:[~2004-09-29 15:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-29 7:43 Hannes Reinecke
2004-09-29 12:04 ` Alan Cox
2004-09-29 13:56 ` James Bottomley
2004-09-29 13:17 ` Alan Cox
2004-09-29 14:24 ` James Bottomley
2004-09-29 14:44 ` Hannes Reinecke
2004-09-29 15:15 ` James Bottomley
2004-09-29 15:28 ` Matthew Wilcox [this message]
2004-09-29 15:35 ` James Bottomley
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=20040929152834.GH16153@parcelfarce.linux.theplanet.co.uk \
--to=matthew@wil.cx \
--cc=James.Bottomley@SteelEye.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=hare@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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
all inboxes | Powered by JetHome®