Repository navigation
Commit d55f7cb
bcache: fix error info in register_bcache()
In register_bcache(), there are several cases we didn't set
correct error info (return value and/or error message):
- if kzalloc() fails, it needs to return ENOMEM and print
"cannot allocate memory";
- if register_cache() fails, it's better to propagate its
return value rather than using default EINVAL.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20211020143812.6403-4-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 0a2b3e3 commit d55f7cb
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2617 | 2617 | | |
2618 | 2618 | | |
2619 | 2619 | | |
2620 | | - | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
2621 | 2623 | | |
| 2624 | + | |
2622 | 2625 | | |
2623 | 2626 | | |
2624 | 2627 | | |
| |||
2629 | 2632 | | |
2630 | 2633 | | |
2631 | 2634 | | |
2632 | | - | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
2633 | 2638 | | |
| 2639 | + | |
2634 | 2640 | | |
2635 | 2641 | | |
2636 | | - | |
| 2642 | + | |
| 2643 | + | |
2637 | 2644 | | |
2638 | 2645 | | |
2639 | 2646 | | |
| |||
0 commit comments