lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a8748490707041700q18608e3ave4465f1181b97e2f@mail.gmail.com>
Date:	Thu, 5 Jul 2007 02:00:07 +0200
From:	"Jesper Juhl" <jesper.juhl@...il.com>
To:	"WANG Cong" <xiyou.wangcong@...il.com>
Cc:	rolandd@...co.com, mshefty@...ips.intel.com, halr@...taire.com,
	"Andrew Morton" <akpm@...l.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [-mm Patch] INFINIBAND: check the return value of kmalloc

On 04/07/07, WANG Cong <xiyou.wangcong@...il.com> wrote:
>
> Don't forget to check the return value of kmalloc().
>
> Signed-off-by: WANG Cong <xiyou.wangcong@...il.com>
>
> ---
>
> Index: linux-2.6.22-rc6-mm1/drivers/infiniband/hw/cxgb3/iwch_provider.c
> ===================================================================
> --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c       2007-06-29 13:18:20.000000000 +0800
> +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c       2007-07-04 23:17:02.000000000 +0800
> @@ -1166,6 +1166,10 @@
>         dev->ibdev.iwcm =
>             (struct iw_cm_verbs *) kmalloc(sizeof(struct iw_cm_verbs),

While you are here anyway, why not get rid of that pointless kmalloc()
return value cast at the same time?

>                                            GFP_KERNEL);
> +       if (!dev->ibdev.iwcm) {
> +               ret = -1;
> +               goto bail1;
> +       }
>         dev->ibdev.iwcm->connect = iwch_connect;
>         dev->ibdev.iwcm->accept = iwch_accept_cr;
>         dev->ibdev.iwcm->reject = iwch_reject_cr;


-- 
Jesper Juhl <jesper.juhl@...il.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ