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: <ecb0ae9ca884c385bc6b0358b38e5605.squirrel@host171.canaca.com>
Date:	Tue, 8 Nov 2011 14:57:28 -0500
From:	simon@...gewell.org
To:	"Thomas Meyer" <thomas@...3r.de>
Cc:	"Jiri Kosina" <jkosina@...e.cz>, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: hid-lg4ff: Casting (void *) value returned by
 kmalloc is useless

No objection from me if this is the proper way to do things.
Simon.

> From: Thomas Meyer <thomas@...3r.de>
>
>  Casting (void *) value returned by kmalloc is useless
>  as mentioned in Documentation/CodingStyle, Chap 14.
>
>  The semantic patch that makes this change is available
>  in scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci.
>
>  More information about semantic patching is available at
>  http://coccinelle.lip6.fr/
>
> Signed-off-by: Thomas Meyer <thomas@...3r.de>
> ---
>
> diff -u -p a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
> --- a/drivers/hid/hid-lg4ff.c 2011-11-07 19:37:44.816570939 +0100
> +++ b/drivers/hid/hid-lg4ff.c 2011-11-08 09:03:29.394045138 +0100
> @@ -430,7 +430,7 @@ int lg4ff_init(struct hid_device *hid)
>  	}
>
>  	/* Add the device to device_list */
> -	entry = (struct lg4ff_device_entry *)kzalloc(sizeof(struct
> lg4ff_device_entry), GFP_KERNEL);
> +	entry = kzalloc(sizeof(struct lg4ff_device_entry), GFP_KERNEL);
>  	if (!entry) {
>  		hid_err(hid, "Cannot add device, insufficient memory.\n");
>  		return -ENOMEM;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.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