re: staging: dgnc: Fix frame size is larger than 1024B

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

 



Hello Konrad Zapalowicz,

The patch ea6e9dea2e72: "staging: dgnc: Fix frame size is larger than
1024B" from Aug 6, 2014, leads to the following static checker
warning:

	drivers/staging/dgnc/dgnc_tty.c:479 dgnc_sniff_nowait_nolock()
	error: scheduling with locks held: 'spin_lock:ch_lock'

drivers/staging/dgnc/dgnc_tty.c
   467  void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar *text, uchar *buf, int len)
   468  {
   469          struct timeval tv;
   470          int n;
   471          int r;
   472          int nbuf;
   473          int i;
   474          int tmpbuflen;
   475          char *tmpbuf;
   476          char *p;
   477          int too_much_data;
   478  
   479          tmpbuf = kzalloc(TMPBUFLEN, GFP_KERNEL);
                                            ^^^^^^^^^^

This is a sleeping under spinlock bug.

   480          if (!tmpbuf)
   481                  return;
   482          p = tmpbuf;

Normally the way to fix these is to just do a GFP_ATOMIC allocation but
sometimes you can shuffle the lock and the allocation around to avoid
the problem.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux