[PATCH] dma-buf: propagate errors from dma_buf_describe() on debugfs read

Mathias Krause minipli at googlemail.com
Sun Jun 19 10:43:30 UTC 2016


On 19 June 2016 at 10:45, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Fri, Jun 17, 2016 at 08:57:03PM +0200, Mathias Krause wrote:
>> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
>> index 6355ab38d630..0f2a4592fdd2 100644
>> --- a/drivers/dma-buf/dma-buf.c
>> +++ b/drivers/dma-buf/dma-buf.c
>> @@ -881,10 +881,9 @@ static int dma_buf_describe(struct seq_file *s)
>>
>>  static int dma_buf_show(struct seq_file *s, void *unused)
>>  {
>> -     void (*func)(struct seq_file *) = s->private;
>> +     int (*func)(struct seq_file *) = s->private;
>>
>> -     func(s);
>> -     return 0;
>> +     return func(s);
>
> Probably even better to just nuke that indirection. Set this pointer to
> NULL and inline dma_buf_describe into dma_buf_show.

Even further, we can get rid of dma_buf_debugfs_create_file() too as
it's only used to create this indirection.
I'll send a v2 just doing that.

Thanks,
Mathias


More information about the dri-devel mailing list