Commit 68eeb08
fbdev: Use device_create_with_groups() to fix sysfs groups registration race
The fbdev sysfs attributes are registered after sending the uevent for
the device creation, leaving a race window where e.g. udev rules may
not be able to access the sysfs attributes because the registration is
not done yet.
Fix this by switching to device_create_with_groups(). This also results in
a nice cleanup. After switching to device_create_with_groups() all that
is left of fb_init_device() is setting the drvdata and that can be passed
to device_create[_with_groups]() too. After which fb_init_device() can
be completely removed.
Dropping fb_init_device() + fb_cleanup_device() in turn allows removing
fb_info.class_flag as they were the only user of this field.
Fixes: 5fc830d ("fbdev: Register sysfs groups through device_add_group")
Cc: stable@vger.kernel.org
Cc: Shixiong Ou <oushixiong@kylinos.cn>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Helge Deller <deller@gmx.de>1 parent 120adae commit 68eeb08
2 files changed
Lines changed: 3 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
451 | 449 | | |
452 | 450 | | |
453 | 451 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
| 452 | + | |
481 | 453 | | |
482 | 454 | | |
483 | 455 | | |
484 | 456 | | |
485 | 457 | | |
486 | 458 | | |
487 | 459 | | |
488 | | - | |
| 460 | + | |
| 461 | + | |
489 | 462 | | |
490 | 463 | | |
491 | 464 | | |
492 | 465 | | |
493 | 466 | | |
494 | | - | |
495 | | - | |
496 | 467 | | |
497 | 468 | | |
498 | 469 | | |
| |||
505 | 476 | | |
506 | 477 | | |
507 | 478 | | |
508 | | - | |
509 | 479 | | |
510 | 480 | | |
511 | 481 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
497 | 496 | | |
498 | 497 | | |
499 | 498 | | |
| |||
0 commit comments