Re: [CHECKER] question about functions that can fail

Rusty Russell (rusty@rustcorp.com.au)
Thu, 22 Mar 2001 09:09:21 +1100


In message <200103192149.NAA29973@csl.Stanford.EDU> you write:
> skb_queue_len : 56 : 2:

skb_queue_len not being checked? Look at these two places: either
your analysis has a bug, or there's some wierd code...

skb_push and skb_pull return the new skb data region, but have more
important side effects. All these three can never error.

> get_tuple : 44 : 5:

pcmcia code, or netfilter code? netfilter code always checks...

> mod_timer : 13 : 163:

This is OK. Most people don't care if mod_timer had to delete the old
timer or not.

> del_timer : 36 : 444:

Whether ignoring this is OK or not is tricky. If del_timer returns
false, you either never added the timer, it has already finished, or
it is running *now* (SMP). Hence touching the timer struct contents
after an unchecked del_timer is v. v. suspect, eg:

del_timer(&mytimer);
kfree(mytimer->data);

Or an unchecked del_timer in module unload. del_timer_sync on the
other hand, is safe.

Keep up the great work!
Rusty.

--
Premature optmztion is rt of all evl. --DK
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/