From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (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 8369C29A1 for ; Tue, 17 Feb 2026 20:58:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771361887; cv=none; b=MfmyuY6FweypdS2bHD1V4FbCxJSsRTgKb+7jIir8PLdbFhjeWWghRMs1CS2i9UPhzjBegltoI6WGdTsbx3n1V5JiVWri2r/TEXQM5LYQZjCpkWqm6nu7HPc4i+yk5CWhb/lNQS3uHQylOCdhYB27n57vV/C1QuGqrL2Z9rJh1C8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771361887; c=relaxed/simple; bh=xraqz6oAeDWHXJQpanhFiK5KtMlpxZP1rwypJBi7DAc=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=Nr2/a6bLamy+HEDm/pzjm7D/TCVF8hiXPgfZs6DUyyl2iex1TQfbqNvLZe+E0cpdrsPGsOFpOjBk1iB8gzrcMItJVOJDj5jeR/w+eQd7RGGn5oRTIPqHrmwt1ou5ZcdaeXM1Vthd5raXRrGDx2O/N87eTgA/QFYHI9EIFs5aWEg= 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=IFPVdXqK; arc=none smtp.client-ip=209.85.160.182 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="IFPVdXqK" Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-506a297c14bso45658431cf.2 for ; Tue, 17 Feb 2026 12:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771361885; x=1771966685; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gDTrjwCgrkQiE6misp2vgl4Q79L7V/FkAsh2FP0TYnA=; b=IFPVdXqKaIA0W0Xdbtg8Y7voBOTvgwQ78hcGWRxTDfkFlyK38MjrbjrtH2irVmVihi 79MnBgp8V5GaTxl8voDPO74QDQeRevoPvpt4oGdt7QN1CuXa6tNrQp9cMynzXWhfw9bu /X8SqHQlQuh5hgpvn9regdjTeLFFBWq1y8szdKra3z12ZsMZfk+/imrStiS968mEEmsa 0EjScOJkHit3dXyZrTrU2PziAOLR/nGKjKhlyRUPhBQS1Dko6bGKlYppFSRpRZ3XHozw /1D9bRBY7FCVNqn/2BBBPXckwkizLOLzaK5T5wco2HuwejGhgGjzkbLSMzSxI2Jdg6pL xGIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771361885; x=1771966685; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=gDTrjwCgrkQiE6misp2vgl4Q79L7V/FkAsh2FP0TYnA=; b=YdkBZrLagUQmOo2CEXxgv65SLVx2UHJPbIeXK872E0BBZ6azMxPVZukHBp1eGYQPwt XhFr3n5ppvqib512slCkkluZjjzjJJhwev2HFsbU/G/4I90c5teM0TrDZwfz0/vm7mCZ XCs+7/Xv7Srx7L1pEF9IFYGkzxIzOuflAYRZU8XrBee1+tfsXmB4/rtornR+tCJ8dqVk tzDiXo9R901vymY9PUsETSiPYFJMntSBLWzK4DC8jIz0VUn/7pREWoP9xhwMxaFEWxL6 oebf+Oc+p3p+wrwXzsPz0Zkwyar2kHEl3zx85cU6/zgLsL6TvL6u24xq7wpog2cXeXst L2tA== X-Forwarded-Encrypted: i=1; AJvYcCXyFqJ+UAWvoufnj/vZj62iI8i+PEoF0T7BvyzYeXL3DSs/Wqg9m/GxqNh2wAPgOibglQ89SVIPTlGX6Fw=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7FmpYeUlFiOjYY6vh9Od4p+9GefpAMKZHLQifDvqa26Spgo35 8J8sHB3ToJGXYrHEw6/j1HF+EUdQNu4/YeqV5+Tu1M8hD02GGKiGoOQWFwiTJafoY2c= X-Gm-Gg: AZuq6aIBhU9S96veqAYb+NJ454D6sPtRV+yseyJ+dIuohp/qPt7+iK4mGo2R2/AiXZh WDuAFNTPjsqUN1XmekssXzJUjOYw+P205GEtTyRccTZLj0NDOcocqeEloRznQp7/izTGh4JErlN 1S8WAyqL45utg68bVLJkkVDnJFhpm8dCtBs198TUi9WBRS9HHBKXm9+q3ZDayp9e+YXoHzeN97x xRhPnihlik0KNqTgYiUmk6AjG2KA9NaCZPhm0eCXlvL5dxxWQA3lVj1lFBXz8BI/i072elzLLr3 mhfKHv9BtdNORR5hhtiUF0qQtVrTVxhngN7weEfmKHsGeZs3+f/1UgdIOVOvFO25mfI0Upwml/p xWMUZg13Wks+wcp+1a4xJXGT+JZ41Eb117D3zV+NYNgUy6ehYvMNxeAD5Ki0coO+nNwiFWPgLhn L683OvQA5zPTNPx+owd5nv474bR/XMjM5hQlQBv9Hohuu1deJQsQ9AKfKUlJe53m7wHdEycy3dv z4U+WkFB9tswmn/y2IzZzEgG6qFWfsGalap/9qElxiBd/+5s+Lf4cOkdNSO9w== X-Received: by 2002:a05:690c:e372:b0:794:e992:8f84 with SMTP id 00721157ae682-797a0cefa54mr119236167b3.56.1771355086116; Tue, 17 Feb 2026 11:04:46 -0800 (PST) Received: from localhost ([2601:7c0:c37c:4c00:e3a8:26f7:7e08:88e1]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7966c254d82sm115204987b3.39.2026.02.17.11.04.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Feb 2026 11:04:45 -0800 (PST) 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 Date: Tue, 17 Feb 2026 13:04:29 -0600 Message-Id: Cc: "Michael Straube" , , Subject: Re: [PATCH v2] staging: rtl8723bs: use kzalloc_obj() instead of kzalloc() From: "Ethan Tidmore" To: "Mariyam Shahid" , "Greg Kroah-Hartman" X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260217103402.4359-1-mariyam.shahid135@gmail.com> In-Reply-To: <20260217103402.4359-1-mariyam.shahid135@gmail.com> On Tue Feb 17, 2026 at 4:34 AM CST, Mariyam Shahid wrote: > Replace kzalloc() using sizeof(*ptr) with kzalloc_obj() to improve > type safety. kzalloc_obj() ensures that the size allocated matches > the type of the pointer automatically, which prevents potential > mismatches if the pointer type is ever refactored. > > This change cleans up a checkpatch.pl warning: > "Prefer kzalloc_obj over kzalloc with sizeof" > > Signed-off-by: Mariyam Shahid > --- > > v2: Resending now that kzalloc_obj() is available in the tree. > Just updated my staging-next tree and kzalloc_obj() isn't there? Make sure you're using staging-next when creating patches for staging. > drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/= rtl8723bs/core/rtw_mlme.c > index 22dc36e8e38a..8cb9a760f763 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c > @@ -1954,7 +1954,7 @@ signed int rtw_set_key(struct adapter *adapter, str= uct security_priv *psecurityp > } > =20 > if (enqueue) { > - pcmd =3D kzalloc(sizeof(*pcmd), GFP_KERNEL); > + pcmd =3D kzalloc_obj(pcmd, GFP_KERNEL); You still need to dereference pcmd here or this doesn't compile. Please at least compile test your patches before sending them off. Thanks, ET