Explorar o código

IB/sa: Error handling thinko fix

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>
Ali Ayoub %!s(int64=18) %!d(string=hai) anos
pai
achega
3c10c7c929
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/infiniband/core/sa_query.c

+ 1 - 1
drivers/infiniband/core/sa_query.c

@@ -531,7 +531,7 @@ static int alloc_mad(struct ib_sa_query *query, gfp_t gfp_mask)
 					    query->sm_ah->pkey_index,
 					    query->sm_ah->pkey_index,
 					    0, IB_MGMT_SA_HDR, IB_MGMT_SA_DATA,
 					    0, IB_MGMT_SA_HDR, IB_MGMT_SA_DATA,
 					    gfp_mask);
 					    gfp_mask);
-	if (!query->mad_buf) {
+	if (IS_ERR(query->mad_buf)) {
 		kref_put(&query->sm_ah->ref, free_sm_ah);
 		kref_put(&query->sm_ah->ref, free_sm_ah);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}