i5400_edac: Avoid calling pci_put_device() twice
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 12 Feb 2012 11:21:34 +0000 (08:21 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 21 Mar 2012 18:22:49 +0000 (15:22 -0300)
commit0142877aa4e54dd9943fb727e9b386c36c8e3ab7
treea417008857f8bb421052bf22b2ce03be49053f5e
parentdf95e42e1f20a561f2fe0a632d5b8fd6c26f1bb9
i5400_edac: Avoid calling pci_put_device() twice

When i5400_edac driver is removed and re-loaded a few times, it causes
an OOPS, as it is currently decrementing some PCI device usage two
times.

When called inside a loop, pci_get_device() will call
pci_put_device(). That mangles the error count. In this specific
case, it seems easier to just duplicate the call.

Also fixes the error logic when pci_get_device fails.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/edac/i5400_edac.c