[lkml]   [2004]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Patch] Fix oops on rmmod usb-storage
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
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:06    [W:0.026 / U:3.844 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site