linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings
@ 2008-07-04 23:46 Harvey Harrison
  2008-07-06  7:26 ` Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Harvey Harrison @ 2008-07-04 23:46 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, Andrew Morton

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

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 drivers/ide/ide-cd_ioctl.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c
index fbacb7c..3a2ffd0 100644
--- a/drivers/ide/ide-cd_ioctl.c
+++ b/drivers/ide/ide-cd_ioctl.c
@@ -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)
-- 
1.5.6.1.322.ge904b




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings
  2008-07-04 23:46 [PATCH] ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings Harvey Harrison
@ 2008-07-06  7:26 ` Borislav Petkov
  2008-07-08 18:00   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2008-07-06  7:26 UTC (permalink / raw)
  To: Harvey Harrison, bzolnier; +Cc: linux-ide, Andrew Morton

On Fri, Jul 04, 2008 at 04:46:53PM -0700, Harvey Harrison wrote:
> 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
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

Acked-by: Borislav Petkov <petkovbb@gmail.com>

> ---
>  drivers/ide/ide-cd_ioctl.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c
> index fbacb7c..3a2ffd0 100644
> --- a/drivers/ide/ide-cd_ioctl.c
> +++ b/drivers/ide/ide-cd_ioctl.c
> @@ -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)
> -- 
> 1.5.6.1.322.ge904b
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ide" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Regards/Gruß,
    Boris.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings
  2008-07-06  7:26 ` Borislav Petkov
@ 2008-07-08 18:00   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-07-08 18:00 UTC (permalink / raw)
  To: petkovbb; +Cc: Harvey Harrison, linux-ide, Andrew Morton

On Sunday 06 July 2008, Borislav Petkov wrote:
> On Fri, Jul 04, 2008 at 04:46:53PM -0700, Harvey Harrison wrote:
> > 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
> > 
> > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> 
> Acked-by: Borislav Petkov <petkovbb@gmail.com>

applied

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-08 18:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-04 23:46 [PATCH] ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings Harvey Harrison
2008-07-06  7:26 ` Borislav Petkov
2008-07-08 18:00   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).