From 71eb3db934d779c3a2e397025068088994afb94e Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Wed, 17 Jun 2026 10:50:15 +0200 Subject: [PATCH] platform/x86: toshiba_bluetooth: Use more common error handling code in toshiba_bt_rfkill_probe() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use an existing label once more so that a bit of exception handling can be better reused at the end of this function implementation. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Link: https://patch.msgid.link/fa7a5865-6dda-4305-ab48-e0c9310520c8@web.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- drivers/platform/x86/toshiba_bluetooth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c index e00abba58c7c..bf199fba4999 100644 --- a/drivers/platform/x86/toshiba_bluetooth.c +++ b/drivers/platform/x86/toshiba_bluetooth.c @@ -252,10 +252,8 @@ static int toshiba_bt_rfkill_probe(struct platform_device *pdev) platform_set_drvdata(pdev, bt_dev); result = toshiba_bluetooth_sync_status(bt_dev); - if (result) { - kfree(bt_dev); - return result; - } + if (result) + goto err_free_bt_dev; bt_dev->rfk = rfkill_alloc("Toshiba Bluetooth", &pdev->dev,