All of lore.kernel.org
 help / color / mirror / Atom feed
* Possible NULL pointer dereference in m32r
@ 2010-02-01 21:36 Steve Kemp
  0 siblings, 0 replies; only message in thread
From: Steve Kemp @ 2010-02-01 21:36 UTC (permalink / raw)
  To: linux-kernel

   arch/m32r/kernel/smp.c contains the following code:

--
    preempt_disable();
    cpu_id = smp_processor_id();
    mmc = &mm->context[cpu_id];
    cpu_mask = mm->cpu_vm_mask;
    cpu_clear(cpu_id, cpu_mask);

#iffdef DEBUG_SMP
   if (!mm)
       BUG();
#endif
--

  mm might be NULL, but this would only be detected after it
 has been dereferenced, and only then if DEBUG_SMP is defined.

  I'd suggest changing to read something like this:

--
    if ( !mm )
        BUG();

    preempt_disable();
--

Steve
--
http://www.steve.org.uk/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-01 21:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01 21:36 Possible NULL pointer dereference in m32r Steve Kemp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.