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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 27 Jan 2019 18:08:36 -0500
From:   valdis.kletnieks@...edu
To:     Bharath Vedartham <linux.bhar@...il.com>
cc:     jic23@...nel.org, knaack.h@....de, lars@...afoo.de,
        pmeerw@...erw.net, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers: iio: industrialio-core: add check when kzalloc fails

On Thu, 24 Jan 2019 19:58:00 +0530, Bharath Vedartham said:
> add code to handle the case when kzalloc fails to allocate memory to dev
>
> Signed-off-by: Bharath Vedartham <linux.bhar@...il.com>

>  		dev_set_name(&dev->dev, "iio:device%d", dev->id);
>  		INIT_LIST_HEAD(&dev->buffer_list);
> +	} else {
> +		return NULL;
>  	}
>  
>  	return dev;

Not needed, as the 'if (dev)' statement fails, dev is already null.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ