From: Dan Carpenter Date: Sat, 1 Aug 2015 23:08:17 +0000 (-0700) Subject: hv: util: checking the wrong variable X-Git-Tag: v4.1.12-124.31.3~892 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b8e511f8387cadd4d975bf8719403fb6da37bb2f;p=users%2Fjedix%2Flinux-maple.git hv: util: checking the wrong variable 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 Reviewed-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman Orabug: 27426102 (cherry picked from commit 9dd6a06430c94299651d74b9ed5ca8396ab8ff1f) Signed-off-by: Jack Vogel Reviewed-by: Tim Tianyang Chen --- diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c index ac5eae5eb76c..1505ee6e6605 100644 --- a/drivers/hv/hv_utils_transport.c +++ b/drivers/hv/hv_utils_transport.c @@ -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;