lkml.org 
[lkml]   [2020]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH][next] afs: fix a dereference on pointer cell before cell is null checked
Date
Colin King <colin.king@canonical.com> wrote:

> @@ -606,7 +605,7 @@ void afs_unuse_cell(struct afs_net *net, struct afs_cell *cell, enum afs_cell_tr
>
> u = atomic_read(&cell->ref);
> a = atomic_dec_return(&cell->active);
> - trace_afs_cell(debug_id, u, a, reason);
> + trace_afs_cell(cell->debug_id, u, a, reason);

It's probably better to read cell->debug_id before calling
atomic_dec_return().

I have a patch for this based on a report by Dan Carpenter, so no need to send
a revised patch.

Thanks,
David

\
 
 \ /
  Last update: 2020-10-27 12:06    [W:0.201 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site