kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch]  hv: util: checking the wrong variable
@ 2015-05-29 15:12 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2015-05-29 15:12 UTC (permalink / raw)
  To: kernel-janitors

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>

diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c
index ea7ba5e..6a9d80a 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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch]  hv: util: checking the wrong variable
@ 2015-06-02 12:15 Vitaly Kuznetsov
  0 siblings, 0 replies; 2+ messages in thread
From: Vitaly Kuznetsov @ 2015-06-02 12:15 UTC (permalink / raw)
  To: kernel-janitors

Dan Carpenter <dan.carpenter@oracle.com> writes:

> 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>

Thanks, Dan!

>
> diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c
> index ea7ba5e..6a9d80a 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;

-- 
  Vitaly

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-02 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-02 12:15 [patch] hv: util: checking the wrong variable Vitaly Kuznetsov
  -- strict thread matches above, loose matches on Subject: below --
2015-05-29 15:12 Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).