diff options
author | Anton Blanchard <anton@samba.org> | 2007-10-26 08:00:14 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-29 04:18:03 -0400 |
commit | 30fa0d0f0c0ab2aa0d4c2f88eda49eaa19ea6f8d (patch) | |
tree | 1d6ef70f9e3b512c34c5ae7082eccf8464801f43 /drivers/scsi/sg.c | |
parent | acd054a5ef401e03e0047b487e572442614f81e5 (diff) |
Initialise scatter/gather list in sg driver
After turning on DEBUG_SG I hit a fail:
kernel BUG at include/linux/scatterlist.h:50!
sg_build_indirect
sg_build_reserve
sg_open
chrdev_open
__dentry_open
do_filp_open
do_sys_open
We should initialise the sg list when we allocate it in sg_build_sgat.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index b5fa4f091387..f1871ea04045 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1652,6 +1652,7 @@ sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp, int tablesize) | |||
1652 | schp->buffer = kzalloc(sg_bufflen, gfp_flags); | 1652 | schp->buffer = kzalloc(sg_bufflen, gfp_flags); |
1653 | if (!schp->buffer) | 1653 | if (!schp->buffer) |
1654 | return -ENOMEM; | 1654 | return -ENOMEM; |
1655 | sg_init_table(schp->buffer, tablesize); | ||
1655 | schp->sglist_len = sg_bufflen; | 1656 | schp->sglist_len = sg_bufflen; |
1656 | return tablesize; /* number of scat_gath elements allocated */ | 1657 | return tablesize; /* number of scat_gath elements allocated */ |
1657 | } | 1658 | } |