Re: [Bugme-new] [Bug 8329] New: mtplan.c: kmalloc while spinlock is held

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 15 Apr 2007 13:46:16 -0700 bugme-daemon@xxxxxxxxxxxxxxxxxxx wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=8329
> 
>            Summary: mtplan.c: kmalloc while spinlock is held
>     Kernel Version: 2.6.20
>             Status: NEW
>           Severity: normal
>              Owner: jgarzik@xxxxxxxxx
>          Submitter: matthias.kaehlcke@xxxxxxxxx
> 
> 
> Problem Description:
> 
> under some conditions mpt_lan_type_trans() can do a kmalloc(GFP_KERNEL) while
> the spinlock bad_naa_lock is held
> 
> drivers/message/fusion/mptlan.c:
> 
> ...
>                 write_lock_irq(&bad_naa_lock);
>                 for (prevnh = nh = mpt_bad_naa; nh != NULL;
>                      prevnh=nh, nh=nh->next) {
>                         if ((nh->ieee[0] == fch->saddr[0]) &&
>                             (nh->ieee[1] == fch->saddr[1]) &&
>                             (nh->ieee[2] == fch->saddr[2]) &&
>                             (nh->ieee[3] == fch->saddr[3]) &&
>                             (nh->ieee[4] == fch->saddr[4]) &&
>                             (nh->ieee[5] == fch->saddr[5])) {
>                                 found = 1;
>                                 dlprintk ((KERN_INFO "mptlan/type_trans: ARP Re"
>                                          "q/Rep w/ bad NAA from system already"
>                                          " in DB.\n"));
>                                 break;
>                         }
>                 }
> 
>                 if ((!found) && (nh == NULL)) {
> 
>                         nh = kmalloc(sizeof(struct NAA_Hosed), GFP_KERNEL);
> ...
> 
> AFAIK this should not be done as kmalloc could sleep while holding the spinlock
> 

yup.  And the fact that nobody has ever reported a might_sleep() warning
coming out of there makes me think that it is dead code.

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux