Date: Fri, 20 Feb 2004 08:32:13 -0700 From: "Kenneth D. Merry" <ken@freebsd.org> To: Colin Percival <colin.percival@wadham.ox.ac.uk> Cc: scsi@freebsd.org Subject: Re: commit approval Message-ID: <20040220153213.GA16894@panzer.kdm.org> In-Reply-To: <6.0.1.1.1.20040220151626.03b34568@imap.sfu.ca> References: <6.0.1.1.1.20040220151626.03b34568@imap.sfu.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
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@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@FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040220153213.GA16894>
