hv: util: checking the wrong variable
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 1 Aug 2015 23:08:17 +0000 (16:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2015 05:29:45 +0000 (22:29 -0700)
We don't catch this allocation failure because there is a typo and we
check the wrong variable.

Fixes: 14b50f80c32d ('Drivers: hv: util: introduce hv_utils_transport abstraction')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv_utils_transport.c

index ea7ba5ef16a90c2f834378c7675193033309671c..6a9d80a5332d31f264c0ff36ac4464264bfcb40d 100644 (file)
@@ -186,7 +186,7 @@ int hvutil_transport_send(struct hvutil_transport *hvt, void *msg, int len)
                return -EINVAL;
        } else if (hvt->mode == HVUTIL_TRANSPORT_NETLINK) {
                cn_msg = kzalloc(sizeof(*cn_msg) + len, GFP_ATOMIC);
-               if (!msg)
+               if (!cn_msg)
                        return -ENOMEM;
                cn_msg->id.idx = hvt->cn_id.idx;
                cn_msg->id.val = hvt->cn_id.val;