]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerAlexander Shishkin <alexander.shishkin@linux.intel.com>
Fri, 18 Nov 2016 14:54:39 +0000 (16:54 +0200)
commit1405a15db004441606e4caf00de3114f37b11fe5
tree40ea96d5814491ac0f0e784c75bc69b24ecabf7d
parent2985d194ef10cb23fea52fc79820308ef56759e5
stm class: Fix device leak in open error path

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: 278e92d8a8f9 ("stm class: Introduce an abstraction for...")
Cc: stable@vger.kernel.org # v4.6+
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
drivers/hwtracing/stm/core.c