Re: [PATCH 2.6.13-rc2-mm2 2/7] v9fs: VFS file, dentry, and directory operations (2.0.2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -383,9 +379,10 @@ v9fs_file_write(struct file *filp, const
>  		return -ENOMEM;
>  
>  	ret = copy_from_user(buffer, data, count);
> -	if (ret)
> +	if (ret) {
>  		dprintk(DEBUG_ERROR, "Problem copying from user\n");
> -	else
> +		return -EFAULT;
> +	} else
>  		ret = v9fs_write(filp, buffer, count, offset);
>  
>  	kfree(buffer);

Aren't you leaking buffer in the error case?  Also we Linux people really
hate an else clause when the if block contains a return statement ;-)

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux