Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b7250f9 authored by Colin Ian King's avatar Colin Ian King Committed by Martin K. Petersen
Browse files

scsi: dpt_i2o: remove redundant null check on array device



The null check on pHba->channel[chan].device is redundant because
device is an array and hence can never be null. Remove the check.

Detected by CoverityScan, CID#115362 ("Array compared against 0")

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 0b2ce198
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -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)
	if(chan < 0 || chan >= MAX_CHANNEL)
		return NULL;
		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;
	}

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