summaryrefslogtreecommitdiff
path: root/block/bsg.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-12-17 15:16:46 +0100
committerTejun Heo <tj@kernel.org>2010-12-17 15:16:46 +0100
commit275c8b93288ef0c2281e414e069ea8ed4bad03f7 (patch)
treedf906ef901d7719d66944921c7436f5db718dc2f /block/bsg.c
parent909ea96468096b07fbb41aaf69be060d92bd9271 (diff)
parent8f1d97c79eb65de1d05799d6b81d79cd94169114 (diff)
downloadlinux-3.10-275c8b93288ef0c2281e414e069ea8ed4bad03f7.tar.gz
linux-3.10-275c8b93288ef0c2281e414e069ea8ed4bad03f7.tar.bz2
linux-3.10-275c8b93288ef0c2281e414e069ea8ed4bad03f7.zip
Merge branch 'this_cpu_ops' into for-2.6.38
Diffstat (limited to 'block/bsg.c')
-rw-r--r--block/bsg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/block/bsg.c b/block/bsg.c
index f20d6a789d4..0c8b64a1648 100644
--- a/block/bsg.c
+++ b/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,