Skip to content

Commit

Permalink
IB/sa: Error handling thinko fix
Browse files Browse the repository at this point in the history
ib_create_send_mad() returns an error code pointer on error, not NULL.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Ali Ayoub authored and Roland Dreier committed Oct 10, 2007
1 parent 339e264 commit 3c10c7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/sa_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ static int alloc_mad(struct ib_sa_query *query, gfp_t gfp_mask)
query->sm_ah->pkey_index,
0, IB_MGMT_SA_HDR, IB_MGMT_SA_DATA,
gfp_mask);
if (!query->mad_buf) {
if (IS_ERR(query->mad_buf)) {
kref_put(&query->sm_ah->ref, free_sm_ah);
return -ENOMEM;
}
Expand Down

0 comments on commit 3c10c7c

Please sign in to comment.