Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/multicast: Check ib_find_pkey() return value

This patch avoids that Coverity complains about not checking the
ib_find_pkey() return value.

Fixes: commit 547af76521b3 ("IB/multicast: Report errors on multicast groups if P_key changes")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Bart Van Assche and committed by
Doug Ledford
d3a2418e 11b642b8

+5 -2
+5 -2
drivers/infiniband/core/multicast.c
··· 518 518 process_join_error(group, status); 519 519 else { 520 520 int mgids_changed, is_mgid0; 521 - ib_find_pkey(group->port->dev->device, group->port->port_num, 522 - be16_to_cpu(rec->pkey), &pkey_index); 521 + 522 + if (ib_find_pkey(group->port->dev->device, 523 + group->port->port_num, be16_to_cpu(rec->pkey), 524 + &pkey_index)) 525 + pkey_index = MCAST_INVALID_PKEY_INDEX; 523 526 524 527 spin_lock_irq(&group->port->lock); 525 528 if (group->state == MCAST_BUSY &&