commit approval

Kenneth D. Merry ken at freebsd.org
Fri Feb 20 07:32:15 PST 2004


On Fri, Feb 20, 2004 at 15:22:04 +0000, Colin Percival wrote:
> Dear mentor and scsi maintainers,
>   Is the following commit ok?
> 
> Colin Percival
> 
> Log:
> Check that periph is non-NULL before dereferencing it.
> 
> Reported by:	"Ted Unangst" <tedu at coverity.com>
> 
> Index: src/sys/cam/scsi/scsi_da.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/cam/scsi/scsi_da.c,v
> retrieving revision 1.163
> diff -u -r1.163 scsi_da.c
> --- src/sys/cam/scsi/scsi_da.c	18 Feb 2004 21:36:50 -0000	1.163
> +++ src/sys/cam/scsi/scsi_da.c	20 Feb 2004 14:59:52 -0000
> @@ -464,11 +464,11 @@
> 
>  	s = splsoftcam();
>  	periph = (struct cam_periph *)dp->d_drv1;
> -	unit = periph->unit_number;
>  	if (periph == NULL) {
>  		splx(s);
>  		return (ENXIO);	
>  	}
> +	unit = periph->unit_number;
> 
>  	softc = (struct da_softc *)periph->softc;
> 

Looks fine, feel free to commit.

Ken
-- 
Kenneth Merry
ken at FreeBSD.org


More information about the freebsd-scsi mailing list