Re: [PATCH][next] mm/zswap: fix potential uninitialized pointer read on tmp

2021-01-28 Thread Andrew Morton
On Thu, 28 Jan 2021 16:18:23 +0100 Vlastimil Babka wrote: > On 1/28/21 3:17 PM, Colin King wrote: > > From: Colin Ian King > > > > In the case where zpool_can_sleep_mapped(pool) returns 0 > > then tmp is not allocated and tmp is then an uninitialized > > pointer. Later if entry is null, tmp is

Re: [PATCH][next] mm/zswap: fix potential uninitialized pointer read on tmp

2021-01-28 Thread Vlastimil Babka
On 1/28/21 3:17 PM, Colin King wrote: > From: Colin Ian King > > In the case where zpool_can_sleep_mapped(pool) returns 0 > then tmp is not allocated and tmp is then an uninitialized > pointer. Later if entry is null, tmp is freed, hence free'ing > an uninitialized pointer. Fix this by ensuring t

[PATCH][next] mm/zswap: fix potential uninitialized pointer read on tmp

2021-01-28 Thread Colin King
From: Colin Ian King In the case where zpool_can_sleep_mapped(pool) returns 0 then tmp is not allocated and tmp is then an uninitialized pointer. Later if entry is null, tmp is freed, hence free'ing an uninitialized pointer. Fix this by ensuring tmp is initialized to NULL. Addresses-Coverity: ("