Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4184924a authored by Luis Henriques's avatar Luis Henriques Committed by Greg Hackmann
Browse files

UPSTREAM: zram: fix possible use after free in zcomp_create()



commit 3aaf14da807a4e9931a37f21e4251abb8a67021b upstream.

zcomp_create() verifies the success of zcomp_strm_{multi,single}_create()
through comp->stream, which can potentially be pointing to memory that
was freed if these functions returned an error.

While at it, replace a 'ERR_PTR(-ENOMEM)' by a more generic
'ERR_PTR(error)' as in the future zcomp_strm_{multi,siggle}_create()
could return other error codes.  Function documentation updated
accordingly.

Bug: 25951511

Change-Id: I9346eb152e2b4fb8e1942e2acd6483d488297f94
Fixes: beca3ec7 ("zram: add multi stream functionality")
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
Acked-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: default avatarMinchan Kim <minchan@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f750aea0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment