From: Ian Abbott Date: Tue, 20 Aug 2013 10:50:19 +0000 (+0100) Subject: staging: comedi: pcmuio: fix possible NULL deref on detach X-Git-Tag: v3.12-rc1~183^2~186 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fd2bdfccae61efe18f6b92b6a45fbf936d75b48;p=pandora-kernel.git staging: comedi: pcmuio: fix possible NULL deref on detach pcmuio_detach() is called by the comedi core even if pcmuio_attach() returned an error, so `dev->private` might be `NULL`. Check for that before dereferencing it. Also, as pointed out by Dan Carpenter, there is no need to check the pointer passed to `kfree()` is non-NULL, so remove that check. Signed-off-by: Ian Abbott Cc: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed