[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e03a89f-726d-9351-6235-9b610e8a9389@tom.com>
Date: Wed, 24 May 2023 16:23:57 +0800
From: Longsuhui <Jack_sun@....com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
Su Hui <suhui@...china.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
YongSu Yoo <yongsuyoo0215@...il.com>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] media: dvb_ringbuffer: Return -EFAULT if copy fails
On 2023/5/24 15:20, Dan Carpenter wrote:
> On Wed, May 24, 2023 at 01:20:27PM +0800, Su Hui wrote:
>> It's confusing about the comment on function declaration.
>>
>> /**
>> * dvb_ringbuffer_write_user - Writes a buffer received via a user
>> pointer
>>
>> ..........
>>
>> * Return: number of bytes transferred or -EFAULT
>>
>> But the function Only returns the number of bytes transferred.
>>
>> Maybe the comment should be modified because it never returns -EFAULT.
> To be honest, I think that -EFAULT is probably a better return. But
> there is no way we could apply the patch with that commit message. The
> commit message doesn't explain the problem for the user or why returning
> the number of bytes copied is not correct in this case.
>
> I think that maybe it's not too late to change this to return -EFAULT,
> but it would have been easier to make the change in 2014 before there
> were many users. Also it would be easier if you were testing this on
> real hardware.
>
> Possibly other people think the current behavior is correct or that it
> is too late to change it. That's also fine. I'm not a domain expert
> here.
I understand it.
Thanks a lot!
Su Hui
>
> regards,
> dan carpenter
>
Powered by blists - more mailing lists