[PATCH v2] nvmet-rdma: Fix a possible uninitialized variable dereference

Christoph Hellwig hch at lst.de
Mon Mar 13 12:56:50 PDT 2017


On Mon, Mar 13, 2017 at 03:39:41PM +0200, Sagi Grimberg wrote:
> When handling a new recv command, we grab a new rsp resource and
> check for the queue state being live. In case the queue is not in
> live state, we simply restore the rsp back to the free list. However
> in this flow we didn't set rsp->queue yet, so we cannot dereference it.
> 
> Instead, make sure to initialize rsp->queue (and other rsp members)
> as soon as possible so we won't reference uninitialized variables.

Looks good,

Reviewed-by: Christoph Hellwig <hch at lst.de>



More information about the Linux-nvme mailing list