Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756608AbcLNTgC (ORCPT ); Wed, 14 Dec 2016 14:36:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35128 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756561AbcLNTgA (ORCPT ); Wed, 14 Dec 2016 14:36:00 -0500 Subject: Re: [PATCH 1/1] infiniband: hw: mlx4: fix improper return value To: Pan Bian , Leon Romanovsky , Yishai Hadas , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org References: <1480833938-6284-1-git-send-email-bianpan201603@163.com> Cc: linux-kernel@vger.kernel.org, Pan Bian From: Doug Ledford Message-ID: <93e36d99-86b5-03b0-3226-2993c428e155@redhat.com> Date: Wed, 14 Dec 2016 14:35:44 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <1480833938-6284-1-git-send-email-bianpan201603@163.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="m1Oui1a7Tix9JXTr6v5mJ9jX8rxFWhls3" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 14 Dec 2016 19:35:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2746 Lines: 66 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m1Oui1a7Tix9JXTr6v5mJ9jX8rxFWhls3 Content-Type: multipart/mixed; boundary="0I4sFi7Lo6LNn4gSWm4Rg1Fd4Gv5OJHnj"; protected-headers="v1" From: Doug Ledford To: Pan Bian , Leon Romanovsky , Yishai Hadas , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Pan Bian Message-ID: <93e36d99-86b5-03b0-3226-2993c428e155@redhat.com> Subject: Re: [PATCH 1/1] infiniband: hw: mlx4: fix improper return value References: <1480833938-6284-1-git-send-email-bianpan201603@163.com> In-Reply-To: <1480833938-6284-1-git-send-email-bianpan201603@163.com> --0I4sFi7Lo6LNn4gSWm4Rg1Fd4Gv5OJHnj Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12/4/2016 1:45 AM, Pan Bian wrote: > From: Pan Bian >=20 > If uhw->inlen is non-zero, the value of variable err is 0 if the copy > succeeds. Then, if kzalloc() or kmalloc() returns a NULL pointer, it > will return 0 to the callers. As a result, the callers cannot detect th= e > errors. This patch fixes the bug, assign "-ENOMEM" to err before the > NULL pointer checks, and remove the initialization of err at the > beginning. >=20 > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=3D189031 > Signed-off-by: Pan Bian Thanks, applied. --=20 Doug Ledford GPG Key ID: 0E572FDD --0I4sFi7Lo6LNn4gSWm4Rg1Fd4Gv5OJHnj-- --m1Oui1a7Tix9JXTr6v5mJ9jX8rxFWhls3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJYUZ8QAAoJELgmozMOVy/dlT0QAJFWxNLZ/m/+u7ltfxyRUQXV COhg94To0jqinqD66LUiUE593wd/x1f9RYRph1BrrFeO5Ux6YD13carcfbG4AhZd 9J0bFgj9iUedIgoQCqDCDx4fucLN1g11584ueMi+8zOjX6UcShnmNd9APfdFY+JI 4wRVNj8c1y3fVNUprbMBEf2BM/YGW58mS1/9gr0dV9GxNu0G50cPrca9LLT2ZsVx 91+Dx69kyM2dCRIDnnRrhuehrn7ghXrW30Hh5NTFLXY6HOzB2UBiU9D0M0HZ4h3p HKFwimAzhBj9SsJlauWiEKGE+W+iXO5vAFXVO5HqGH4fGGscfcPuoGlymJ5vyR0K 2JA/gtimT5qwGEWHpeB4Qwajx+eYlxqpCmdua7nXz1XqWDaCt1aHpxzi09D1yItL EHVdcVVV2XSfwbJeD1qzu5INiDLiaI9iMVusxu8Z3vdsIBmj/MSg1ECJ6N3xM2rB YiOHik/jCDU8J84uDZvQuj3oiWChtmKkwdwIfRV0sHS2YCSpo3iVhfbHtNioOzfw 33v4zMcmV8G9MPBefodfy8EhHi6ampGiAHuxJMXF6V8hsmhrmx5D+vDiNsMMQbet oRoxNlRfsgq1TVriqlfhE5aKJW82s5iqsmEVgZeonSZMm3kay+NioLjGKobaVuly daewPcNTD8zbpxDqMlNG =oG58 -----END PGP SIGNATURE----- --m1Oui1a7Tix9JXTr6v5mJ9jX8rxFWhls3--