Re: [PATCH] cdx: Fix cdx_mmap_resource() after constifying attr in ->mmap()

From: Thomas Weißschuh
Date: Fri Nov 08 2024 - 13:11:28 EST


Nov 8, 2024 12:54:41 Nathan Chancellor <nathan@xxxxxxxxxx>:

> On Fri, Nov 08, 2024 at 12:23:50PM -0500, Thomas Weißschuh wrote:
>> Nov 7, 2024 12:07:56 Nathan Chancellor <nathan@xxxxxxxxxx>:
>>> Fixes: 94a20fb9af16 ("sysfs: treewide: constify attribute callback of bin_attribute::mmap()")
>>
>> I'm not sure about the Fixes tag.
>> cdx.c is not yet in mainline and this change should be folded into the cdx patch or the sysfs patch, depending on their order in the merge window.
>> I guess Greg will take care of it.
>
> This code is in mainline, so I think the Fixes tag is correct?

Indeed. Sorry for the noise.
I re-checked this before writing the other mail, but somehow failed.
(Maybe because I did it on a phone)

I'm wondering how this got through 0day, too.
Anyways, it shouldn't matter.
Thanks again for the fix!

>   $ git grep cdx_mmap_resource v6.12-rc1 drivers/cdx/cdx.c
>   v6.12-rc1:drivers/cdx/cdx.c: * cdx_mmap_resource - map a CDX resource into user memory space
>   v6.12-rc1:drivers/cdx/cdx.c:static int cdx_mmap_resource(struct file *fp, struct kobject *kobj,
>   v6.12-rc1:drivers/cdx/cdx.c:        res_attr->mmap = cdx_mmap_resource;
>
> The error is reproducible on driver-core-next since that is what I based
> this change on.
>
> Thanks for the review!
>
> Cheers,
> Nathan