]> git.karo-electronics.de Git - linux-beck.git/commitdiff
IB/sa: Error handling thinko fix
authorAli Ayoub <ali@mellanox.co.il>
Sun, 9 Sep 2007 11:55:11 +0000 (14:55 +0300)
committerRoland Dreier <rolandd@cisco.com>
Wed, 10 Oct 2007 02:59:07 +0000 (19:59 -0700)
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>
drivers/infiniband/core/sa_query.c

index d271bd715c12920a9a0e907f28865e1e120a816e..312c8ff5ae888a44ad0c9c34ac5e1138ac4b18a4 100644 (file)
@@ -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;
        }