From nobody Fri Jul 24 23:35:55 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C911647252A; Wed, 22 Jul 2026 07:48:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784706531; cv=none; b=pL3qODLk9W9XvOlsJo1fjou5FkRE+wu/vQdgVooTR836geQv7gEksEgg1cYJGy9Vldv4lB6Y0ECmLKikfe1EWBecbZYdqnj6mEazCSpcq5IXC5IQbURCj1gZZcpJN2j0+SWJu2w2BzTTmesqRmNenlmfW5nY5ujE+pg4E9aL2XI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784706531; c=relaxed/simple; bh=s8lQqe5vzN2YPXC7Wi77W8LiNIiC5l1dppDO5B7Pjx4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=rcJZ7ZibyEoof4H6RqqsJIPtGjj7ORAt12elBoJHlO9XKfyydn32EBqeu8BSSslonay4zKRkS2Dy4ioTaAYUHjVgaaCIH8Czo/LGwO9byVBOLwjYfdcbY6jRUsO3vr6jPwBmgVrNmOZzR2j41HnYLU72tedoKZPDxXht7niRXuU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: c22b5ea885a111f1aa26b74ffac11d73-20260722 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:28bb0f39-c763-4d27-bed3-8bee11637f08,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:98e32168fad54163c843d049e436a096,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|136|850|865|898,TC:nil,Content:0|15| 50,EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0 ,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: c22b5ea885a111f1aa26b74ffac11d73-20260722 X-User: lilinmao@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1833979615; Wed, 22 Jul 2026 15:48:41 +0800 From: Linmao Li To: Jonathan Cameron Cc: David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Andreas Brauchli , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Linmao Li Subject: [PATCH] iio: chemical: sgp30: Handle IAQ thread creation failure Date: Wed, 22 Jul 2026 15:48:37 +0800 Message-Id: <20260722074837.2258269-1-lilinmao@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" kthread_run() can fail and return an error pointer, but sgp_probe() stores it and returns success, so the device is registered without its IAQ thread and sgp_remove() later passes the error pointer to kthread_stop(). Return the error from probe instead. Fixes: ce514124161a ("iio: chemical: sgp30: Support Sensirion SGP30/SGPC3 s= ensors") Signed-off-by: Linmao Li Reviewed-by: Joshua Crofts --- drivers/iio/chemical/sgp30.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iio/chemical/sgp30.c b/drivers/iio/chemical/sgp30.c index f10bbebc29e4..379c1c4af8d8 100644 --- a/drivers/iio/chemical/sgp30.c +++ b/drivers/iio/chemical/sgp30.c @@ -548,6 +548,9 @@ static int sgp_probe(struct i2c_client *client) =20 data->iaq_thread =3D kthread_run(sgp_iaq_threadfn, data, "%s-iaq", data->client->name); + if (IS_ERR(data->iaq_thread)) + return dev_err_probe(dev, PTR_ERR(data->iaq_thread), + "failed to start IAQ thread\n"); =20 return 0; } --=20 2.25.1