lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 8 Aug 2014 19:03:32 +0200 (CEST)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	James Bottomley <James.Bottomley@...senPartnership.com>
cc:	Adaptec OEM Raid Solutions <aacraid@...ptec.com>,
	kernel-janitors@...r.kernel.org, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org, joe@...ches.com
Subject: Re: [PATCH 1/1] dpt_i2o: delete unnecessary null test on array

> > diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
> > index 67283ef..62e276b 100644
> > --- a/drivers/scsi/dpt_i2o.c
> > +++ b/drivers/scsi/dpt_i2o.c
> > @@ -1169,11 +1169,6 @@ static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u6
> >  	if(chan < 0 || chan >= MAX_CHANNEL)
> >  		return NULL;
> >
> > -	if( pHba->channel[chan].device == NULL){
> > -		printk(KERN_DEBUG"Adaptec I2O RAID: Trying to find device before they are allocated\n");
> > -		return NULL;
> > -	}
>
> dpt_i2o is always weirdly fun, but I think, based on the message, this
> check is supposed to be
>
> if( pHba->channel[chan].device[id] == NULL){
>
> Since device is an array of device pointers which are allocated by
> parsing data.

That seems to be already checked immediately below:

        d = pHba->channel[chan].device[id];
	if(!d || d->tid == 0) {
                return NULL;
        }

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists