diff --git a/[refs] b/[refs] index 0026fff2b236..99f7797dbc11 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 057f02a38e67a944a2d0b89bb0111efb9dbe6e6e +refs/heads/master: c7a841f3aca469187db76842676951a672fd27d1 diff --git a/trunk/block/bsg.c b/trunk/block/bsg.c index f20d6a789d48..0c8b64a16484 100644 --- a/trunk/block/bsg.c +++ b/trunk/block/bsg.c @@ -250,6 +250,14 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm, int ret, rw; unsigned int dxfer_len; void *dxferp = NULL; + struct bsg_class_device *bcd = &q->bsg_dev; + + /* if the LLD has been removed then the bsg_unregister_queue will + * eventually be called and the class_dev was freed, so we can no + * longer use this request_queue. Return no such address. + */ + if (!bcd->class_dev) + return ERR_PTR(-ENXIO); dprintk("map hdr %llx/%u %llx/%u\n", (unsigned long long) hdr->dout_xferp, hdr->dout_xfer_len, (unsigned long long) hdr->din_xferp,