Re: [PATCH 3/6] staging/ft1000-usb: fix build warnings

From: Arnd Bergmann
Date: Mon Oct 04 2010 - 09:49:30 EST


On Monday 04 October 2010, Belisko Marek wrote:
> > if (qtype) {
> > }
> > @@ -756,6 +762,7 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command,
> > if (tempword & FT1000_DB_DPRAM_TX) {
> > DEBUG("FT1000:ft1000_ChIoctl:Doorbell not available\n");
> > result = -ENOTTY;
> > + kfree(dpram_data);
> is shift of kfree() needed or just a typo?
> > break;
> > }
> > }

Indentation in this driver is largely broken (should be using tabs only, but
uses tabs and spaces). I didn't want to add to this, but I guess it doesn't
matter much either way.

You should probably split larger functions into multiple smaller ones where
sensible so you can do a proper reindentation of the whole driver.

> Anyway there is also compilation warning:
> In function âcopy_from_userâ,
> inlined from âft1000_ChIoctlâ at
> drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c:709:36:
> /home/open-nandra/kernels/linux-next/arch/x86/include/asm/uaccess_32.h:212:26:
> warning: call to âcopy_from_user_overflowâ declared with attribute
> warning: copy_from_user() buffer size is not provably correct
>

This warning is compiler dependent, so it didn't show up on my system.
Just make an extra patch for it.

Arnd
--
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/