From: Ian Abbott Date: Wed, 3 Oct 2012 15:25:15 +0000 (+0100) Subject: staging: comedi: 8255_pci: fix possible NULL deref during detach X-Git-Tag: v3.7-rc3~13^2~18 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4dd2367f3ad276fe49c89a522267ea5ccb6bf80;p=pandora-kernel.git staging: comedi: 8255_pci: fix possible NULL deref during detach `pci_8255_detach()` will be called by the comedi core if `pci_8255_attach_pci()` returns an error. It currently assumes that both `board` (assigned from the return value of `comedi_board(dev)`) and `devpriv` (assigned from `dev->private`) are non-null, but they might be null, leading to a null pointer dereference. `pci_8255_detach()` doesn't need to do anything if either `board` or `devpriv` are null, so just return early in this case. Cc: # 3.6.x Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed