IB/ehca: fix handling idr_alloc result
authorAndrzej Hajda <a.hajda@samsung.com>
Mon, 21 Sep 2015 13:33:36 +0000 (15:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Oct 2015 18:50:05 +0000 (19:50 +0100)
commit43b2ec01d2140964d98ea7812ca2f9dff67d2db2
treefb8f06925406ac3a154a29678da57de752723260
parent0bc2763f569ff9533a8222bcb884ef0e22569a72
IB/ehca: fix handling idr_alloc result

The function can return negative value.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rdma/ehca/ehca_cq.c