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]
Date:   Thu, 13 Oct 2016 15:45:00 -0500
From:   Don Brace <brace77070@...il.com>
To:     Javier Martinez Canillas <javier@....samsung.com>
Cc:     iss_storagedev@...com, linux-scsi@...r.kernel.org,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        esc.storagedev@...rosemi.com,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: hpsa: remove unneeded void pointer cast

On 10/13/2016 11:10 AM, Javier Martinez Canillas wrote:
> It's not necessary to cast the result of kmalloc, since void pointers are
> promoted to any other type. This also fixes following coccinelle warning:
>
> casting value returned by memory allocation function to (BIG_IOCTL_Command_struct *) is useless.
>
> Signed-off-by: Javier Martinez Canillas <javier@....samsung.com>
> ---
>
>   drivers/scsi/hpsa.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index d007ec18179a..4e82b692298e 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -6657,8 +6657,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
>   		return -EINVAL;
>   	if (!capable(CAP_SYS_RAWIO))
>   		return -EPERM;
> -	ioc = (BIG_IOCTL_Command_struct *)
> -	    kmalloc(sizeof(*ioc), GFP_KERNEL);
> +	ioc = kmalloc(sizeof(*ioc), GFP_KERNEL);
>   	if (!ioc) {
>   		status = -ENOMEM;
>   		goto cleanup1;
Acked-by: Don Brace <don.brace@...rosemi.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ