Commit 655a8a7
HID: nintendo: Fix an error handling path in nintendo_hid_probe()
joycon_leds_create() has a ida_alloc() call. So if an error occurs after
it, a corresponding ida_free() call is needed, as already done in the
.remove function.
This is not 100% perfect, because if ida_alloc() fails, then
'ctlr->player_id' will forced to be U32_MAX, and an error will be logged
when ida_free() is called.
Considering that this can't happen in real life, no special handling is
done to handle it.
Fixes: 5307de6 ("HID: nintendo: use ida for LED player id")
Signed-off-by: Christophe JAILLET <[email protected]>
Reviewed-by: Silvan Jegen <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>1 parent ce3af2e commit 655a8a7
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2725 | 2725 | | |
2726 | 2726 | | |
2727 | 2727 | | |
2728 | | - | |
| 2728 | + | |
2729 | 2729 | | |
2730 | 2730 | | |
2731 | 2731 | | |
2732 | 2732 | | |
2733 | 2733 | | |
2734 | | - | |
| 2734 | + | |
2735 | 2735 | | |
2736 | 2736 | | |
2737 | 2737 | | |
2738 | 2738 | | |
2739 | 2739 | | |
2740 | 2740 | | |
2741 | 2741 | | |
| 2742 | + | |
| 2743 | + | |
2742 | 2744 | | |
2743 | 2745 | | |
2744 | 2746 | | |
| |||
0 commit comments