FMC: fix locking in sample chardev driver
authorAlessandro Rubini <rubini@gnudd.com>
Tue, 16 Jul 2013 10:58:01 +0000 (12:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 05:56:52 +0000 (22:56 -0700)
commit783c2fb1b8ba2f057a26f881aa452d4aa8e4b3f4
tree13f18c989ccb4e748b8db58532faf24450b5c958
parent5f90b9b484938f7466e25cd5506e86ebf9dbcd17
FMC: fix locking in sample chardev driver

The fmc-chardev module was over-locking, by calling misc
register/unregister while holding its spinlock.  This reported a
"scheduling while atomic" error.

Since the misc driver already serializes operations internally, this
commit downgrades the fmc-chardev lock to just cover its own list.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fmc/fmc-chardev.c