Commit c741816
timekeeping: Fix error code in tk_aux_sysfs_init()
If kobject_create_and_add() fails on the first iteration, then the error
code is set to -ENOMEM which is correct. But if it fails in subsequent
iterations then "ret" is zero, which means success, but it should be
-ENOMEM.
Set the error code to -ENOMEM correctly.
Fixes: 7b5ab04 ("timekeeping: Fix resource leak in tk_aux_sysfs_init() error paths")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Malaya Kumar Rout <[email protected]>
Link: https://patch.msgid.link/[email protected]1 parent ac3fd01 commit c741816
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3073 | 3073 | | |
3074 | 3074 | | |
3075 | 3075 | | |
3076 | | - | |
| 3076 | + | |
| 3077 | + | |
3077 | 3078 | | |
| 3079 | + | |
3078 | 3080 | | |
3079 | 3081 | | |
3080 | 3082 | | |
| |||
0 commit comments