locking problem in ibmphp_hp.c

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

 



There was a potential locking issue found by smatch static checker.

drivers/pci/hotplug/ibmphp_hpc.c
   889                          up (&semOperations);
   890                          msleep(POLL_INTERVAL_SEC * 1000);
   891
   892                          if (kthread_should_stop())
   893                                  break;

We break here with semOperations released.

   894
   895                          down (&semOperations);
   896
   897                          if (poll_count >= POLL_LATCH_CNT) {
   898                                  poll_count = 0;
   899                                  poll_state = POLL_SLOTS;
   900                          } else
   901                                  poll_state = POLL_LATCH_REGISTER;
   902                          break;

We break here with semOperations held.

   903                  }
   904                  /* give up the hardware semaphore */

We release semOperations here a second time which may be wrong since
it was already released.

   905                  up (&semOperations);

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

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux