From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9391A3BB4A for ; Mon, 16 Feb 2026 08:45:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771231549; cv=none; b=Ug7P0XJZ9QkyEJGwdJKFG7Q7d2FMgCkizaP1e+Z2EvoAbhXF9GD/f18hmLwndrec5QO3x8QSGfubcFNNy+2xrTX/3PEJe9PAWa69X43myfmekXwGZrrRVCYFPxu2NS+OTvs/9o9QV2yXG86zrIVEOhKrp96WBDRWnksug1sn7TQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771231549; c=relaxed/simple; bh=YV/8XQJR2BaDti+aiMeFsE8qQijmvXtUMemVuIe3X6U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GQqAUyx81LZphxCLupJKxrqioahp4f1yRSAbjLOPKoV77n4i47Ji0FRmbrTiXnMpwPjVFYB8DiHGjTJt7LV+yIwnGUn/LpspKrvNFE26uk89rwLll1BZ/IiX5vHeJ05HldNS0CxuR4qSdJGUxBnr15bsT7ldULVHd1lTEsm12TI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B8ebj9qi; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B8ebj9qi" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-482f2599980so31641815e9.0 for ; Mon, 16 Feb 2026 00:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771231547; x=1771836347; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=YV/8XQJR2BaDti+aiMeFsE8qQijmvXtUMemVuIe3X6U=; b=B8ebj9qizutTkg5ht2TpGed2VAyvMViIIPUOeEdj5mhq2JXViOYloh4tsA8QXAKQ9p T+IAfbZSM2m+ezQ2Ir4Q7uXuniJdW5IuwTLMxOVT2i8kyOi5G6zO5rZyhEAlijDvhOFU 6W+0bJa0iv6FMiPSjJSEseiwV/uabuQAVobEebhEJw6Bqw5ds68CW1E3Vp9W0XkVulm3 LE1T5RwNsstk1k23waZo03ycQtUs2M8Ul0yVbq95RvJiWi/6rtndm9kHT378kQlmmB03 CRTXJDEb4vHDfA0UYYp6sR2qArSUElQPKJ4p+498N3MZHTHooO3tvksuwyOTHcNBTKje ZgmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771231547; x=1771836347; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YV/8XQJR2BaDti+aiMeFsE8qQijmvXtUMemVuIe3X6U=; b=L+ufDS1IlIwGEKELJIHBCq/OamL0VSdf/Sdn0Z4Xz1dfoKIc/B7ilHL9wq6ouOG8CB 1CbF1AD8ShLQX4YJ5+qulgWtdvptpSS0IugzD5FM+RvWT1DdSu2oCNOjf/VM3WCJfq9c ImndMqApnfw7bktki2mqWkmAscpX5W/Y3K5s59n9IeMuRlbTk/Lj4RQ1pTAjoSdyi8X2 4BjdWtsDHf4G7B8+kf80y8AB/QLDBjMlFLGZbGnpZJoiTt6iLawGljf/cXBn22hiMYMa bhiQIqeS/pUZ6+AQYKVQvJlwbEX4m1O1n58hyYKmxEKU4HB92oO5W6qSxhk1jAptvamA P66g== X-Forwarded-Encrypted: i=1; AJvYcCVASDwabczOgGifunJZ33vXDkf29lWjtjrxDzi5byRdiH8Uho8Vm06HKKPdozljmYe0iAYS/XQhhnS+Vx8=@vger.kernel.org X-Gm-Message-State: AOJu0Yz96PDZIZrw9dalwGJu1YBAnPr9zfXtmOI9R88A9S1AQr2sjrm1 TRVY+/PnCaw0TwmJ4iGAXAj4tWoqlY9LkX48X34tyrcsHaSd9earkvTQz0swow== X-Gm-Gg: AZuq6aJNZL3UO6MU47n4G2Big3O3DMoJiL8xDz7LOrFU7N3hlI56vnKpgK3SCv34IKl x1Fz0Ba1BHSPTdxZly1DjXTyjbPmi4fQ3R6bVrMbJLeubDYFTszrTD9IisdAQan3Huk6SsbfM8y WyIIMwUUy6IaJz8RmfoZ6ewFiNZR9/PWtpJ/aMtVwduLkN3bmplO1pSSakUcuH6OX6h17TowSCA sT3pD2LOfDhWy6RZTXff/ol2hZNKDzw/wC7Mkd6iUJO878u5zAwGAJqwuIbEbhL0fFQe5LiukHp PavQbeajx2Skap1m0ZYEoYVM/tHjvYwCmBY4CoM9o4Hjmnu7odHd7avhDNDAUB0X48fGt9thsrO eYDWniSMbsbyoFHxmCqbK8POw055iyvbLqtqe6+wKgbiUf+7nLVJT6VSku1XBUgeKGjYEJS0rF/ Mu5hIjp2gXlzUA X-Received: by 2002:a05:600c:524d:b0:483:4807:210c with SMTP id 5b1f17b1804b1-48373a5d7a0mr196426675e9.24.1771231546718; Mon, 16 Feb 2026 00:45:46 -0800 (PST) Received: from pc ([196.235.75.121]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d5d78cfsm643512305e9.1.2026.02.16.00.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Feb 2026 00:45:46 -0800 (PST) Date: Mon, 16 Feb 2026 09:45:43 +0100 From: Salah Triki To: Andy Shevchenko Cc: Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] iio: trigger: use put_device() in viio_trigger_alloc() error path Message-ID: References: <20260215222348.186806-1-salah.triki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Andy, You are absolutely right. My previous version (v3) was logically flawed as it could trigger the release callback before the necessary fields were initialized, leading to an unsafe irq_free_descs() call. Since I don't have the physical hardware to perform runtime injection tests,I relied on manual code path analysis and clearly failed to account for the side effects of put_device(). I'm sending a v4 which takes the safer approach: moving device_initialize() after all potential failure points. This way, we can safely use kfree() and irq_free_descs() in the error path without involving the device lifecycle prematurely. Thank you for the catch.