Re: [PATCH] staging: goldfish_audio.c: sparse warning of incorrect type

From: Dan Carpenter
Date: Mon Sep 01 2014 - 05:35:34 EST


On Sun, Aug 31, 2014 at 09:46:22PM +0530, Sudip Mukherjee wrote:
> @@ -133,9 +134,15 @@ static ssize_t goldfish_audio_read(struct file *fp, char __user *buf,
> AUDIO_READ_BUFFER_AVAILABLE);
>
> /* copy data to user space */
> - if (copy_to_user(buf, data->read_buffer, length))
> + buffer = kzalloc(length, GFP_KERNEL);
> + if (buffer == NULL)
> + return -ENOMEM;
> + memcpy_fromio(buffer, data->read_buffer, length);
> + if (copy_to_user((void __user *)buf, buffer, length)) {
^^^^^^^^^^^^^^^
This cast shouldn't be needed.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/