Skip to content

Commit

Permalink
IB/ehca: Require in_wc in process_mad()
Browse files Browse the repository at this point in the history
If the caller does not pass a valid in_wc to process_mad(), return MAD
failure status, as it is not possible to generate a valid MAD redirect
response (and redirects are the only MAD responses ehca generates).

Signed-off-by: Alexander Schmidt <alexs@linux.vnet.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Alexander Schmidt authored and Roland Dreier committed Feb 19, 2010
1 parent fa55e30 commit 45e354e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/ehca/ehca_sqp.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int ehca_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
{
int ret;

if (!port_num || port_num > ibdev->phys_port_cnt)
if (!port_num || port_num > ibdev->phys_port_cnt || !in_wc)
return IB_MAD_RESULT_FAILURE;

/* accept only pma request */
Expand Down

0 comments on commit 45e354e

Please sign in to comment.