[PATCH v3] staging: unisys: Add s-Par visorhba

Greg KH gregkh at linuxfoundation.org
Mon Sep 21 01:52:20 UTC 2015


On Wed, Aug 26, 2015 at 12:11:12AM -0400, Benjamin Romer wrote:
> +	/* convert buffer to phys information */
> +	if ((scsi_sg_count(scsicmd) == 0) && (scsi_bufflen(scsicmd) > 0)) {
> +		BUG_ON(scsi_sg_count(scsicmd) == 0);

Ah nice, you just crashed the kernel and all data is now lost _AND_ the
user has no idea what happened. :(

Never use BUG() or BUG_ON() lines in a driver unless things are just so
horribly hosed that turning the machine off is the only thing that is
possible to do.

Care to fix the places in this patch that you do this?

thanks,

greg k-h


More information about the devel mailing list