ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings
PATCH 1/1 ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings
The function ide_cd_queue_pc should be checked as the bufflen arg is dereferenced and lots of callers are passing in NULL.
drivers/ide/ide-cd_ioctl.c:124:46: warning: Using plain integer as NULL pointer drivers/ide/ide-cd_ioctl.c:149:47: warning: Using plain integer as NULL pointer drivers/ide/ide-cd_ioctl.c:231:46: warning: Using plain integer as NULL pointer drivers/ide/ide-cd_ioctl.c:374:46: warning: Using plain integer as NULL pointer
--- drivers/ide/ide-cd_ioctl.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/ide/ide-cd_ioctl.c +4 -4
@@ -121,7 +121,7 @@ int cdrom_eject(ide_drive_t *drive, int ejectflag, cmd[0 ] =GPCMD_START_STOP_UNIT ; cmd[4 ] = loej | (ejectflag !=0 ); -return ide_cd_queue_pc (drive, cmd,0 ,NULL ,0 , sense,0 ,0 ); +return ide_cd_queue_pc (drive, cmd,0 ,NULL ,NULL , sense,0 ,0 ); }/* Lock the door if LOCKFLAG is nonzero; unlock it otherwise. */
@@ -146,7 +146,7 @@ int ide_cd_lockdoor(ide_drive_t *drive, int lockflag, cmd[0 ] =GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL ; cmd[4 ] = lockflag ?1 :0 ; - stat =ide_cd_queue_pc (drive, cmd,0 ,NULL ,0 , + stat =ide_cd_queue_pc (drive, cmd,0 ,NULL ,NULL , sense,0 ,0 ); }
@@ -228,7 +228,7 @@ int ide_cdrom_select_speed(struct cdrom_device_info *cdi, int speed) cmd[5 ] = speed &0xff ; } - stat =ide_cd_queue_pc (drive, cmd,0 ,NULL ,0 , &sense,0 ,0 ); + stat =ide_cd_queue_pc (drive, cmd,0 ,NULL ,NULL , &sense,0 ,0 );if (!ide_cdrom_get_capabilities (drive, buf)) {ide_cdrom_update_speed (drive, buf);
@@ -371,7 +371,7 @@ static int ide_cd_fake_play_trkind(ide_drive_t *drive, void *arg)lba_to_msf (lba_start, &cmd[3 ], &cmd[4 ], &cmd[5 ]);lba_to_msf (lba_end -1 , &cmd[6 ], &cmd[7 ], &cmd[8 ]); -return ide_cd_queue_pc (drive, cmd,0 ,NULL ,0 , &sense,0 ,0 ); +return ide_cd_queue_pc (drive, cmd,0 ,NULL ,NULL , &sense,0 ,0 ); }static int ide_cd_read_tochdr (ide_drive_t *drive,void *arg)
Signature · 1 line
1.5.6.1.322.ge904b
Quoted 9 lines · Harvey Harrison
The function
ide_cd_queue_pcshould be checked as the bufflen arg is dereferenced and lots of callers are passing in NULL.
drivers/ide/ide-cd_ioctl.c:124:46: warning: Using plain integer as NULL pointerdrivers/ide/ide-cd_ioctl.c:149:47: warning: Using plain integer as NULL pointerdrivers/ide/ide-cd_ioctl.c:231:46: warning: Using plain integer as NULL pointerdrivers/ide/ide-cd_ioctl.c:374:46: warning: Using plain integer as NULL pointerSigned-off-by Harvey Harrison <[email protected]>
Quoted 53 lines
--- drivers/ide/ide-cd_ioctl.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)drivers/ide/ide-cd_ioctl.c +4
-4@@ -121,7 +121,7 @@ int cdrom_eject(ide_drive_t *drive, int ejectflag, cmd[0 ] =GPCMD_START_STOP_UNIT ; cmd[4 ] = loej | (ejectflag !=0 ); -return ide_cd_queue_pc (drive, cmd,0 ,NULL ,0 , sense,0 ,0 ); +return ide_cd_queue_pc (drive, cmd,0 ,NULL ,NULL , sense,0 ,0 ); }/* Lock the door if LOCKFLAG is nonzero; unlock it otherwise. */ @@ -146,7 +146,7 @@ int ide_cd_lockdoor(ide_drive_t *drive, int lockflag, cmd[0 ] =GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL ; cmd[4 ] = lockflag ?1 :0 ; - stat =ide_cd_queue_pc (drive, cmd,0 ,NULL ,0 , + stat =ide_cd_queue_pc (drive, cmd,0 ,NULL ,NULL , sense,0 ,0 ); }@@ -228,7 +228,7 @@ int ide_cdrom_select_speed(struct cdrom_device_info *cdi, int speed) cmd[5 ] = speed &0xff ; } - stat =ide_cd_queue_pc (drive, cmd,0 ,NULL ,0 , &sense,0 ,0 ); + stat =ide_cd_queue_pc (drive, cmd,0 ,NULL ,NULL , &sense,0 ,0 );if (!ide_cdrom_get_capabilities (drive, buf)) {ide_cdrom_update_speed (drive, buf);@@ -371,7 +371,7 @@ static int ide_cd_fake_play_trkind(ide_drive_t *drive, void *arg)lba_to_msf (lba_start, &cmd[3 ], &cmd[4 ], &cmd[5 ]);lba_to_msf (lba_end -1 , &cmd[6 ], &cmd[7 ], &cmd[8 ]); -return ide_cd_queue_pc (drive, cmd,0 ,NULL ,0 , &sense,0 ,0 ); +return ide_cd_queue_pc (drive, cmd,0 ,NULL ,NULL , &sense,0 ,0 ); }static int ide_cd_read_tochdr (ide_drive_t *drive,void *arg)Signature · 8 lines
1.5.6.1.322.ge904b -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Regards/Gruß,
Boris.Bartlomiej Zolnierkiewicz
AppliedQuoted 4 lines · Borislav Petkov
Quoted 3 lines · Harvey Harrison
The function
ide_cd_queue_pcshould be checked as the bufflen arg is dereferenced and lots of callers are passing in NULL.
Quoted 8 lines
Quoted 6 lines
drivers/ide/ide-cd_ioctl.c:124:46: warning: Using plain integer as NULL pointerdrivers/ide/ide-cd_ioctl.c:149:47: warning: Using plain integer as NULL pointerdrivers/ide/ide-cd_ioctl.c:231:46: warning: Using plain integer as NULL pointerdrivers/ide/ide-cd_ioctl.c:374:46: warning: Using plain integer as NULL pointerSigned-off-by Harvey Harrison <[email protected]>Acked-by Borislav Petkov <[email protected]>
applied