summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
commite47f00743fc4776491344f2c618cc8dc2c23bcbc (patch)
tree13e03a113a82a184c51c19c209867cfd3a59b3b9 /drivers/scsi/sg.c
parentb2ad5f821b1381492d792ca10b1eb7a107b48f14 (diff)
Merge with Linux 2.4.0.
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 971783407..04e4a6a28 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -650,6 +650,11 @@ static int sg_common_write(Sg_fd * sfp, Sg_request * srp,
}
/* SCSI_LOG_TIMEOUT(7, printk("sg_write: allocating device\n")); */
SRpnt = scsi_allocate_request(sdp->device);
+ if(SRpnt == NULL) {
+ SCSI_LOG_TIMEOUT(1, printk("sg_write: no mem\n"));
+ sg_finish_rem_req(srp);
+ return -ENOMEM;
+ }
/* SCSI_LOG_TIMEOUT(7, printk("sg_write: device allocated\n")); */
srp->my_cmdp = SRpnt;