Re: [PATCH] fat: Use pointer to d_name[0] in put_user() for compat case

From: Helge Deller
Date: Mon Feb 14 2022 - 05:50:26 EST


On 2/14/22 10:27, Andreas Schwab wrote:
> On Feb 14 2022, David Laight wrote:
>
>> The 'bug' is caused by put_user() trying to do:
>> __typeof__(ptr) __ptr = ptr;
>> where __typeof__ is returning char[n] not char *.
>>
>> I've tried a few things but can't get __typeof__ to
>> generate a suitable type for both a simple type and array.
>
> Does it work to use __typeof__(&*(ptr))?

Yes, this works.

Helge