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  linux-cve-announce  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]
Message-ID: <4F67136D.7080500@redhat.com>
Date:	Mon, 19 Mar 2012 12:07:25 +0100
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Hu Tao <hutao@...fujitsu.com>
CC:	linux-kernel@...r.kernel.org,
	Stefan Hajnoczi <stefanha@...ux.vnet.ibm.com>,
	Mike Christie <michaelc@...wisc.edu>,
	Pekka Enberg <penberg@...nel.org>,
	linux-scsi <linux-scsi@...r.kernel.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	"Michael S. Tsirkin" <mst@...hat.com>, kvm@...r.kernel.org
Subject: Re: [PATCH v5 2/3] virtio-scsi: add error handling

Il 19/03/2012 10:55, Hu Tao ha scritto:
> +	int ret = FAILED;
>  
>  	cmd->comp = &comp;
>  	ret = virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd,
>  			       sizeof cmd->req.tmf, sizeof cmd->resp.tmf,
>  			       GFP_NOIO);
>  	if (ret < 0)
> -		return FAILED;
> +		goto failed;

This will return the errno, not FAILED.

I have already fixed this up locally, though I've been lazy on actually
sending out the fix.  I'll do this today.

Paolo

>  	wait_for_completion(&comp);
> -	if (cmd->resp.tmf.response != VIRTIO_SCSI_S_OK &&
> -	    cmd->resp.tmf.response != VIRTIO_SCSI_S_FUNCTION_SUCCEEDED)
> -		return FAILED;
> +	if (cmd->resp.tmf.response == VIRTIO_SCSI_S_OK ||
> +	    cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED)
> +		ret = SUCCESS;
>  
> -	return SUCCESS;
> +failed:
> +	mempool_free(cmd, virtscsi_cmd_pool);
> +	return ret;

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ