2.6.16-rc3-mm1 - restore zeroing of packet_command struct in sr_ioctl.c
PATCH 1/1 2.6.16-rc3-mm1 - restore zeroing of packet_command struct in sr_ioctl.c
The 'git-scsi-misc' patch removed 2 calls to memset() to zero out a struct packet_command before passing it to sr_do_ioctl(). This causes sr_do_ioctl() to use the uninitialized 'sense' member as a pointer, instead of allocating a new request_sense struct. On my system, this results in an Oops that kills off hald and others.
This patch restores the 2 memset calls.
Signed-off-by Lee Schermerhorn <[email protected]>
drivers/scsi/sr_ioctl.c +2 -0
@@ -48,6 +48,7 @@ static int sr_read_tochdr(struct cdrom_dif (!buffer)return -ENOMEM ; +memset (&cgc,0 ,sizeof (struct packet_command )); cgc.timeout =IOCTL_TIMEOUT ; cgc.cmd[0 ] =GPCMD_READ_TOC_PMA_ATIP ; cgc.cmd[8 ] =12 ;/* LSB of length */
@@ -77,6 +78,7 @@ static int sr_read_tocentry(struct cdromif (!buffer)return -ENOMEM ; +memset (&cgc,0 ,sizeof (struct packet_command )); cgc.timeout =IOCTL_TIMEOUT ; cgc.cmd[0 ] =GPCMD_READ_TOC_PMA_ATIP ; cgc.cmd[1 ] |= (tocentry->cdte_format ==CDROM_MSF ) ?0x02 :0 ;