Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754308AbbGCFq1 (ORCPT ); Fri, 3 Jul 2015 01:46:27 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:56700 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751685AbbGCFqZ (ORCPT ); Fri, 3 Jul 2015 01:46:25 -0400 X-AuditID: cbfee68f-f793b6d000005f66-57-559621af3dc9 From: Maninder Singh To: kys@microsoft.com, haiyangz@microsoft.com, devel@linuxdriverproject.org, linux-kernel@vger.kernel.org Cc: pankaj.m@samsung.com, Maninder Singh Subject: [PATCH 1/1] drivers: hv: hv_utils_transport: Fixing validation of correct pointer Date: Fri, 03 Jul 2015 11:15:33 +0530 Message-id: <1435902333-31308-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGLMWRmVeSWpSXmKPExsWyRsSkSne94rRQg+kL1S0urlrDbHFtu4fF k9Vb2S0u75rDZnF4fhuLxb03W5kc2Dyapy1h9Wjd8Zfdo2/LKkaPz5vkAliiuGxSUnMyy1KL 9O0SuDJ2XWxkLzjBVjGz6R1jA+N+1i5GTg4JAROJeyv/sUHYYhIX7q0Hsrk4hASWMkp0P1rJ CFP0/sghdojEIkaJKe2voJyfjBJL524GG8UmoCexatceFhBbRCBb4tPHo0DdHBzMAk4S07/q gYSFBWIktn1cwAISZhFQlbg2E2w+r4C7ROfpY2DVEgIKEnMm2YBMlxD4zCaxfN81sBoWAQGJ b5MPsUDUyEpsOsAMcZqkxMEVN1gmMAouYGRYxSiaWpBcUJyUXmSsV5yYW1yal66XnJ+7iREY nKf/PevfwXj3gPUhRgEORiUe3gunp4YKsSaWFVfmHmI0BdowkVlKNDkfGAN5JfGGxmZGFqYm psZG5pZmSuK8C6V+BgsJpCeWpGanphakFsUXleakFh9iZOLglGpgFK41XCu9xZnP4pzJVLs5 KkH5LCaF6ve/LjnYcz35oYin7rNejxsRBZelj1TfuDmN8QXP+t3Tj7feMktY/M3kjpR554d/ Ple3bvPXv+HFsHC5ZJ7andvLzXgOyN73FlP/+fjitVu3ktY9m2BsdvdVMpP1+5mHnD9XSAqZ pPmmbfgQyfv7ownPAyWW4oxEQy3mouJEAOy0KY1JAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgkeLIzCtJLcpLzFFi42I5/e+xgO56xWmhBgsOy1hcXLWG2eLadg+L J6u3sltc3jWHzeLw/DYWi3tvtjI5sHk0T1vC6tG64y+7R9+WVYwenzfJBbBENTDaZKQmpqQW KaTmJeenZOal2yp5B8c7x5uaGRjqGlpamCsp5CXmptoqufgE6Lpl5gAtV1IoS8wpBQoFJBYX K+nbYZoQGuKmawHTGKHrGxIE12NkgAYS1jBm7LrYyF5wgq1iZtM7xgbG/axdjJwcEgImEu+P HGKHsMUkLtxbz9bFyMUhJLCIUWJK+yt2COcno8TSuZvBOtgE9CRW7drDAmKLCGRLfPp4lLGL kYODWcBJYvpXPZCwsECMxLaPC1hAwiwCqhLXZjKChHkF3CU6Tx8Dq5YQUJCYM8lmAiP3AkaG VYyiqQXJBcVJ6bmGesWJucWleel6yfm5mxjBof9MagfjygaLQ4wCHIxKPLwXTk8NFWJNLCuu zD3EKMHBrCTC674eKMSbklhZlVqUH19UmpNafIjRFGj3RGYp0eR8YFzmlcQbGpuYmxqbWppY mJhZKonznsz3CRUSSE8sSc1OTS1ILYLpY+LglGpgNNzjt9u+KXF99YlD5+vuvc51nPq5+Mq1 oBcvkoKfBh06aH/w+OfieM2CK5EiN+ZcrRNx0M1f9Ez+3s95H87HbN0zYZ7t1SyZrLcVvsGx d5q2cbvXbTvvaRfd01a92ePX9we9e3tbfty2WsLxV+LRq6texoEnfm53eFgbGXzo6IKt27O+ z5Zm3anEUpyRaKjFXFScCABbZLvkkwIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1061 Lines: 29 cn_msg should be validated instead of msg after memory allocation. Signed-off-by: Maninder Singh Reviewed-by: Akhilesh Kumar --- drivers/hv/hv_utils_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/