lkml.org 
[lkml]   [2004]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    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 majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:06    [W:0.019 / U:86.884 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site