lkml.org 
[lkml]   [2010]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [ceph-devel] bug report: ceph: && vs ||
On Sat, 20 Mar 2010, Dan Carpenter wrote:
>
>
> 1772 /* correct session? */
> 1773 if (!req->r_session && req->r_session != session) {
>
> Is this supposed to || here? We know "session" is non-NULL at
> the point because we already dereferenced it. If "req->r_session"
> is null then the second condition is always true.
>
> Also we dereference "req->r_session" later on without checking.

Yeah, that check is clearly wrong. A

if (req->r_session != session) {

is sufficient because the passed session is always non-NULL. Applied a
fix.

Thanks-
sage


\
 
 \ /
  Last update: 2010-03-21 05:01    [W:0.034 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site