stm class: Fix device leak in open error path
authorJohan Hovold <johan@kernel.org>
Fri, 18 Nov 2016 12:17:31 +0000 (14:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Jan 2017 07:21:53 +0000 (08:21 +0100)
commit3863ab6d710d7d1012c651601bd97403501bbb6f
tree3740268f71595394cc41322b1be7fd255104f64e
parent698ac693dbb4aa3cefa042aecfd08475e97fe390
stm class: Fix device leak in open error path

commit a0ebf519b8a2666438d999c62995618c710573e5 upstream.

Make sure to drop the reference taken by class_find_device() also on
allocation errors in open().

Signed-off-by: Johan Hovold <johan@kernel.org>
Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for...")
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/stm/core.c