From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 280263C1991 for ; Wed, 1 Apr 2026 08:46:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775033192; cv=none; b=dLS+PH6xBr0Hku9e6whKVlIkI6hS1XSZnuva0L2KU6umGdsodlfw3sCdkiKSSsTigocyIfqtPYvTyWRiiUeIjD3hPMzpaaTaXNCt69hIMqX+KWKNl24MIcjG/GkLT6YRZs4wkd2tKtwiEwx3saS8L7TPDculzVxHoBagROD4m54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775033192; c=relaxed/simple; bh=rYDcPkhisb7MzXonfzW190BR7AizLd4YyMRZyjAFwp8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qbzQ3dYPnsokF3Qbicd6QkfZ5KgTSvthZNJKotUuvNTy7jXy2I+0C12Xv2Nmo3q+/bd2Oxufx5izar3OO2PBiJktQrYP8ABcsikoe6FuMbrnfeGQXbbFZt866NQSCRWTB5TwjlKU+xYHUfiT7fQMEGbZK00FkTV1xswxYLT32lU= 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=LNmAXj4J; arc=none smtp.client-ip=209.85.128.51 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="LNmAXj4J" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-486fb14227cso87404185e9.3 for ; Wed, 01 Apr 2026 01:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775033187; x=1775637987; 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=Aobew71sp3lvdyVghFtKMFu9Vc7NsKn2i+4o799a9aI=; b=LNmAXj4JVkDO7PMmhXKKJOXIh1Ji7ioauQ7pgZdqh0jL57hOzyUXJxYvHydhWkLnTh x1VRNXm2SmDzdJVB18qQEwecviiHDeIE2sSN3EUblKWPzJIztuUUpChHxbHoQCA1e4Wi 8BKUBpWQKVKcbpV8Hwsf4Pg3iJDrgOatpNruNUrKINGMetpwSujd9iqMLeuZ+GY15QWq B+AU7yXxYPVpLlWvZ/5kSkABt3Voj9CK4yP05ioldoRvfwFvAlzi6hx3U81OTxx4NgGJ 4Zf/mHeV+aQeGdcwq6DzwMsO4T/JdL/nfTadxXqPx1dECcD5vxbVfOUe9srSr5rPm+xN qN6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775033187; x=1775637987; 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=Aobew71sp3lvdyVghFtKMFu9Vc7NsKn2i+4o799a9aI=; b=O9npsbjGZpu7VofIGaWtaCHd0K+/C6c0dT4ac29IrGxJOSYW/drDDYbBthnSpKYxLm KmKNjk9L+Lwcm0aWmoZvtzjBmc3t+NFAdl8Ubs4PoLDxxk8yMr++cgl6+5kmqvhPCNI0 qEGon7EtmK1GVQNa9hniidT6wlFkvoImTH53aymGEKDg2jTUcvs6g5E6Mzpv/pU7mWOZ VyjnqSB25Pr99QPqYFddKo8hvOKwDTGNUrAdm/KPad3AVQqVO3IrkelRWY52c29fZOax kSJHKa8ZuNiRZEu39Ub6viSSx8r6n8Qzef0VickwJ2Xs2DgBGFkubeLHrEUc4mxg1apM dgwA== X-Forwarded-Encrypted: i=1; AJvYcCWhoOEghClTcW4RH22Ah3F1gHxy0B579Hi8YBGznN55QvboKrf0BJQblr+iTU/mAI02MGnBoTw4BDFTOuY=@vger.kernel.org X-Gm-Message-State: AOJu0YzHLbvGsSE2Zh5mVtP8EYk5e/5AFbctHFkHT2ThCE4fTKIRnskA tbgswt/Jv2iW6sy36fc/cAtJJfPQoDQc14/JmXp4kJE8AKOQjfGlbxSF X-Gm-Gg: ATEYQzwN8pLrWKP7xrPX7uwmNWHMFRNj/R4yL7VnGgSrTm0a7f/4xJpTZZ1U8BYP8D/ Ay6QwceSf3+DvU90E3OQkgMXi5vptPIOiwSX2BSO6ZyYljvlB5iFGWrL90DFk5PDUnayQlB/nB9 baHHoZmI4W+qWLZkN4RWI9ITO3RtmfQdK+Z6ChQq+CunELVd5vlJLiIU6D9U6P1LQRnGqpG60Oo Uo3mYjw0bOUTz95pED16yJge66AxFeAm6wilP3qyhmqa+EEGF/2FT24Bq/NNvFIbSTQZLbiXLoO 91kLCKh6JR6SGU18imr12AB2FSB7WJHvqfGuqH+T5oPmuQQacRcdBmQFbqx+vvKAF9HdiHaZTcn Lq4+5cCcU1xGe8j5N0sL81Pus9QrPK9GDrS60eh+wj8jW1pxfvGB9iMzZOfDlAsvpANVULa507l OMa4YzgamJt6wHrPAS9Yk= X-Received: by 2002:a05:600c:828f:b0:485:4388:348b with SMTP id 5b1f17b1804b1-48883310809mr47319085e9.0.1775033187220; Wed, 01 Apr 2026 01:46:27 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48880d864b7sm34882765e9.3.2026.04.01.01.46.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2026 01:46:26 -0700 (PDT) Date: Wed, 1 Apr 2026 11:46:23 +0300 From: Dan Carpenter To: Omer El Idrissi Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] staging: rtl8723bs: replace function with error handling alternative Message-ID: References: <20260331153255.22764-1-omer.e.idrissi@gmail.com> <20260331153255.22764-5-omer.e.idrissi@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: <20260331153255.22764-5-omer.e.idrissi@gmail.com> On Tue, Mar 31, 2026 at 05:32:53PM +0200, Omer El Idrissi wrote: > Replace the use of rtw_set_hal_ops with rtw_hal_data_init in > rtw_sdio_if1_init , which actually returns error or success and not > void. > rtw_set_hal_ops literally only calls rtw_hal_data_init and just ignores the > possibility of errors. > This is a behavior change and it's quite dangerous. A lot of code only works because there is no error handling. We can't merge it without testing unless it causes a security issue or something. For example, not checking the results of allocations could cause a crash so maybe that's a security bug. > @@ -250,8 +244,9 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct > /* 3 3. init driver special setting, interface, OS and hardware relative */ > > /* 4 3.1 set hardware operation functions */ > - rtw_set_hal_ops(padapter); > - > + /* allocates padapter->HalData */ > + if (rtw_hal_data_init(padapter)) > + goto free_adapter; I don't want to see checks in this style. I always want them to be in this format: ret = rtw_hal_data_init(padapter); if (ret) ... But in this case, just leave it because adding a new check would have to be tested. regards, dan carpenter > > /* 3 5. initialize Chip version */ > padapter->intf_start = &sd_intf_start; > -- > 2.51.0 >