diff options
author | Hui Zhu <[email protected]> | 2022-07-14 16:07:57 +0800 |
---|---|---|
committer | akpm <[email protected]> | 2022-07-29 18:07:15 -0700 |
commit | c7e6f17b52e9486a9d997368819dfec032b550e2 (patch) | |
tree | 8a671ecdc4f7acb88558e20fd08e4a34f853484b /scripts/gdb/linux/tasks.py | |
parent | fef3e9066d19230f661048ca86937d954c12cd50 (diff) |
zsmalloc: zs_malloc: return ERR_PTR on failure
zs_malloc returns 0 if it fails. zs_zpool_malloc will return -1 when
zs_malloc return 0. But -1 makes the return value unclear.
For example, when zswap_frontswap_store calls zs_malloc through
zs_zpool_malloc, it will return -1 to its caller. The other return value
is -EINVAL, -ENODEV or something else.
This commit changes zs_malloc to return ERR_PTR on failure. It didn't
just let zs_zpool_malloc return -ENOMEM becaue zs_malloc has two types of
failure:
- size is not OK return -EINVAL
- memory alloc fail return -ENOMEM.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Hui Zhu <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Nitin Gupta <[email protected]>
Cc: Sergey Senozhatsky <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/tasks.py')
0 files changed, 0 insertions, 0 deletions