]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
stm class: Fix module init return on allocation failure
authorWang Hui <john.wanghui@huawei.com>
Fri, 15 Jan 2021 19:59:16 +0000 (22:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Jan 2021 12:31:14 +0000 (13:31 +0100)
commit83f8cb9aff0ffb8661fb620b7598ca5804bf75ab
tree726987b08928be7b84500cbae7be98c9322ea7b5
parentd5b8aff36114472104fe864cbe43d66ab130c66d
stm class: Fix module init return on allocation failure

commit 927633a6d20af319d986f3e42c3ef9f6d7835008 upstream.

In stm_heartbeat_init(): return value gets reset after the first
iteration by stm_source_register_device(), so allocation failures
after that will, after a clean up, return success. Fix that.

Fixes: 119291853038 ("stm class: Add heartbeat stm source device")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hui <john.wanghui@huawei.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Link: https://lore.kernel.org/r/20210115195917.3184-2-alexander.shishkin@linux.intel.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/stm/heartbeat.c