lkml.org 
[lkml]   [2000]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] bugfixes for PPP driver against 2.3.99p3
On Sat, 25 Mar 2000, Paul Mackerras wrote:

> @@ -213,26 +174,34 @@
> ppp_sync_open(struct tty_struct *tty)
> {
> struct syncppp *ap;
> + int err;
>
> ap = kmalloc(sizeof(*ap), GFP_KERNEL);
> if (ap == 0)
> return -ENOMEM;
>
> - MOD_INC_USE_COUNT;
> -
[...]
> + MOD_INC_USE_COUNT;
> return 0;
> }

Shouldn't the MOD_INC_USE_COUNT be before the kmalloc, with a
MOD_DEC_USE_COUNT on failure cases, for race avoidance?

Tim.
*/


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.050 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site