staging: zram: fix invalid memory references during disk write
Fixes a bug introduced by commit
c8f2f0db1 ("zram: Fix handling
of incompressible pages") which caused invalid memory references
during disk write. Invalid references could occur in two cases:
- Incoming data expands on compression: In this case, reference was
made to kunmap()'ed bio page.
- Partial (non PAGE_SIZE) write with incompressible data: In this
case, reference was made to a kfree()'ed buffer.
Fixes bug 50081:
https://bugzilla.kernel.org/show_bug.cgi?id=50081
Signed-off-by: Nitin Gupta <[email protected]>
Cc: stable <[email protected]>
Reported-by: Mihail Kasadjikov <[email protected]>
Reported-by: Tomas M <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>