Re: [PATCH] fix warning and missing failure handling for scsi_add_host in aic7xxx driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2005-12-14 at 00:07 +0100, Jesper Juhl wrote:
> +	if (retval) {
> +		printk(KERN_ERR "aic7xxx: scsi_add_host failed\n");
> +		goto free_and_out;
> +	}
> +
>  	scsi_scan_host(host);
> -	return (0);
> +
> +out:
> +	return retval;
> +free_and_out:
> +	scsi_remove_host(host);
> +	goto out;

I'm not incredibly keen on all this jumping around for no reason.  If
there's a normal out and an error out, then fine, but in this case the
if (retval) { } could contain the entirety of the error path with an
else for the normal path.

scsi_remove_host() is the wrong API, it should be scsi_host_put() (for
an allocated but un added host).

James


-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux