* Re: [PATCH v13 17/22] media: i2c: maxim-serdes: add MAX96724 driver
From: Dan Carpenter @ 2026-06-15 12:19 UTC (permalink / raw)
To: Niklas Söderlund
Cc: dumitru.ceclan, Tomi Valkeinen, Mauro Carvalho Chehab,
Sakari Ailus, Laurent Pinchart, Julien Massot, Rob Herring,
Greg Kroah-Hartman, mitrutzceclan, linux-media, linux-kernel,
devicetree, linux-staging, linux-gpio, Martin Hecht,
Cosmin Tanislav, Cory Keitz
In-Reply-To: <ail9bHXL_NV2DZK5@stanley.mountain>
On Wed, Jun 10, 2026 at 06:06:20PM +0300, Dan Carpenter wrote:
> On Wed, Jun 10, 2026 at 04:42:42PM +0200, Niklas Söderlund wrote:
> > Hi,
> >
> > Thanks for your work.
> >
> > This patch gives me new compiler warnings, can they be avoided?
> >
> > .../max96724.c:402 max96724_log_phy_status() warn: subtract is higher precedence than shift
> > .../max96724.c:409 max96724_log_phy_status() warn: subtract is higher precedence than shift
> > .../max96724.c:588 max96724_init_phy() warn: subtract is higher precedence than shift
> > .../max96724.c:756 max96724_set_pipe_remap() warn: subtract is higher precedence than shift
> > .../max96724.c:796 max96724_set_pipe_phy() warn: subtract is higher precedence than shift
> > .../max96724.c:818 max96724_set_pipe_stream_id() warn: subtract is higher precedence than shift
> > .../max96724.c:830 max96724_set_pipe_link() warn: subtract is higher precedence than shift
> > .../max96724.c:942 max96724_set_link_version() warn: subtract is higher precedence than shift
> >
>
> These are Smatch warnings. I appologize for them. I know about them
> but I haven't looked at them. I'll fix them by the end of the week.
I've pushed a fix for these to the devel branch of Smatch.
regards,
dan carpenter
^ permalink raw reply
* [PATCH] staging: rtl8723bs: fix line length checkpatch warning
From: Devansh Soni @ 2026-06-15 12:18 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Devansh Soni
Wrap a long pointer arithmetic line to resolve a checkpatch.pl line length warning.
Signed-off-by: Devansh Soni <devanshsoni874@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index c1185c25e..d727a00f2 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -184,7 +184,8 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
return -ENOMEM;
}
- pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
+ pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 -
+ ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
pcmdpriv->cmd_issued_cnt = 0;
pcmdpriv->cmd_done_cnt = 0;
--
2.54.0
^ permalink raw reply related
* [PATCH] staging: greybus: power_supply: remove unnecessary parentheses in return
From: Tomasz Unger @ 2026-06-15 12:13 UTC (permalink / raw)
To: Rui Miguel Silva, Johan Hovold, Alex Elder, Greg Kroah-Hartman
Cc: greybus-dev, linux-staging, linux-kernel, Tomasz Unger
In-Reply-To: <20260615-greybus-power-supply-return-parens-v1-1-dcad9dabfe79.ref@yahoo.pl>
return is not a function, so the parentheses around the returned
expressions are not needed. Remove them to follow kernel coding
style and silence checkpatch.pl RETURN_PARENTHESES warnings.
Verified with checkpatch.pl - no errors or warnings.
Compiled the power_supply object successfully.
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
drivers/staging/greybus/power_supply.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c
index 33b7a63979d6..44bd8a72fa50 100644
--- a/drivers/staging/greybus/power_supply.c
+++ b/drivers/staging/greybus/power_supply.c
@@ -336,7 +336,7 @@ static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
static int is_prop_valint(enum power_supply_property psp)
{
- return ((psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0);
+ return (psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0;
}
static void next_interval(struct gb_power_supply *gbpsy)
@@ -423,7 +423,7 @@ static void check_changed(struct gb_power_supply *gbpsy,
static int total_props(struct gb_power_supply *gbpsy)
{
/* this return the intval plus the strval properties */
- return (gbpsy->properties_count + gbpsy->properties_count_str);
+ return gbpsy->properties_count + gbpsy->properties_count_str;
}
static void prop_append(struct gb_power_supply *gbpsy,
---
base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a
change-id: 20260615-greybus-power-supply-return-parens-b3dd9f4a87c7
Best regards,
--
Tomasz Unger <tomasz.unger@yahoo.pl>
^ permalink raw reply related
* Re: [PATCH v2 1/2] media: atomisp: fix memory leak in atomisp_pci_probe()
From: Dan Carpenter @ 2026-06-15 11:39 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Dawei Feng, andy, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, linux-kernel, linux-media, linux-staging,
jianhao.xu, Zilin Guan, Kees Cook, Jonathan Corbet
In-Reply-To: <ai_d0B8YOZAwnqu_@ashevche-desk.local>
On Mon, Jun 15, 2026 at 02:11:12PM +0300, Andy Shevchenko wrote:
> > The bug was first flagged by an experimental analysis tool we are
> > developing for kernel memory-management bugs while analyzing
> > v6.13-rc1. The tool is still under development and is not yet publicly
> > available. Manual inspection confirms that the bug is still present in
> > v7.1-rc7.
> >
> > An x86_64 allyesconfig build showed no new warnings. As we do not have
> > an Intel Atom ISP platform with the required camera sensor hardware to
> > test with, no runtime testing was able to be performed.
>
> These last two paragraphs do not suit the commit message. Please, drop them
> here and better to describe all this in the cover letter (if not yet).
This is how the documentation says to write commit messages.
https://lore.kernel.org/all/ahgaOigklcDCYvRp@stanley.mountain/
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH v2 2/2] media: atomisp: fix memory leak in atomisp_csi2_bridge_parse_firmware()
From: Andy Shevchenko @ 2026-06-15 11:12 UTC (permalink / raw)
To: Dawei Feng
Cc: andy, error27, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, linux-kernel, linux-media, linux-staging,
jianhao.xu, Zilin Guan
In-Reply-To: <20260615072841.3113700-3-dawei.feng@seu.edu.cn>
On Mon, Jun 15, 2026 at 03:28:41PM +0800, Dawei Feng wrote:
> atomisp_csi2_bridge_parse_firmware() initializes isp->notifier and may
> allocate async notifier connections via v4l2_async_nf_add_fwnode_remote().
> However, these resources are currently leaked if a subsequent entity
> registration or probe step fails, or when the driver is removed.
>
> Fix this by introducing dedicated helpers to clean up and unregister the
> async notifier state. Call atomisp_notifier_cleanup() to release the
> allocated connections in both the entity registration failure path and the
> overall probe unwind path.
>
> Additionally, invoke atomisp_notifier_unregister() during the device
> remove path to ensure the notifier is properly unregistered from the V4L2
> core before its underlying resources are freed.
> Fixes: 8d28ec7e9145 ("media: atomisp: Add support for v4l2-async sensor registration")
> Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
> Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
Same comment as per previous patch regarding to SoB chain.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH v2 1/2] media: atomisp: fix memory leak in atomisp_pci_probe()
From: Andy Shevchenko @ 2026-06-15 11:11 UTC (permalink / raw)
To: Dawei Feng
Cc: andy, error27, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, linux-kernel, linux-media, linux-staging,
jianhao.xu, Zilin Guan
In-Reply-To: <20260615072841.3113700-2-dawei.feng@seu.edu.cn>
On Mon, Jun 15, 2026 at 03:28:40PM +0800, Dawei Feng wrote:
> atomisp_initialize_modules() creates CSI2 and ISP subdev media entities
> before atomisp_pci_probe() registers them. Its counterpart,
> atomisp_uninitialize_modules(), only releases part of that module-owned
> state and leaves some media entity cleanup to the entity unregister path.
>
> That ownership split is incomplete for probe error paths. If
> atomisp_pci_probe() fails after module initialization but before all
> entities are registered, the unwind path cannot rely on unregister
> helpers to release media entity state whose lifetime started in module
> initialization. The CSI2 and ISP subdev media entities can therefore be
> left allocated.
>
> Refactor the cleanup boundary so module cleanup releases media entities
> created by module initialization, while unregister helpers only undo
> registered V4L2 and media device state. Move CSI2 and ISP subdev media
> entity cleanup into atomisp_mipi_csi2_cleanup() and the new
> atomisp_subdev_cleanup(), and run media_device_cleanup() after module
> cleanup in the probe unwind and remove paths.
>
> If atomisp_mipi_csi2_init() itself fails, it has already unwound its
> partial setup, so return the error directly. Only the later
> atomisp_subdev_init() failure path needs to clean up CSI2 from the
> caller.
> The bug was first flagged by an experimental analysis tool we are
> developing for kernel memory-management bugs while analyzing
> v6.13-rc1. The tool is still under development and is not yet publicly
> available. Manual inspection confirms that the bug is still present in
> v7.1-rc7.
>
> An x86_64 allyesconfig build showed no new warnings. As we do not have
> an Intel Atom ISP platform with the required camera sensor hardware to
> test with, no runtime testing was able to be performed.
These last two paragraphs do not suit the commit message. Please, drop them
here and better to describe all this in the cover letter (if not yet).
> Fixes: 9d4fa1a16b28 ("media: atomisp: cleanup directory hierarchy")
> Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
> Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
This SoB chain is wrong. Who is Zilin and why is he here?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH v2 1/1] MAINTAINERS: Camera sensor and Intel IPU driver changes
From: Dave Stevenson @ 2026-06-15 10:19 UTC (permalink / raw)
To: Sakari Ailus
Cc: linux-media, Yong Zhi, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Lixu Zhang, linux-kernel, linux-staging, Bingbu Cao,
David Heidelberg, Richard Acayan
In-Reply-To: <20260605074944.666654-1-sakari.ailus@linux.intel.com>
On Fri, 5 Jun 2026 at 08:49, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
>
> From: Dave Hansen <dave.hansen@linux.intel.com>
>
> Tian Shu Qiu and Bingbu Cao are maintainers and reviewers of a bunch of
> media drivers (7 and 9 respectively). Bingbu's e-mail address has changed
> and Tian Shu's is bouncing.
>
> Update Bingbu's e-mail address, remove Bingbu as a maintainer from Intel
> specific drivers and and remove Tian Shu as maintainer. Also add Dave
> Stevenson as a maintainer and David Heidelberg as a reviewer for the
> imx355 driver.
>
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Yong Zhi <yong.zhi@intel.com>
> Cc: Dan Scally <dan.scally@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Lixu Zhang <lixu.zhang@intel.com>
> Cc: linux-media@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-staging@lists.linux.dev
> Co-developed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> ---
> MAINTAINERS | 29 ++++++++++++-----------------
> 1 file changed, 12 insertions(+), 17 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index efbf808063e5..64478875cd78 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3882,8 +3882,8 @@ F: Documentation/devicetree/bindings/leds/ams,as3668.yaml
> F: drivers/leds/leds-as3668.c
>
> ASAHI KASEI AK7375 LENS VOICE COIL DRIVER
> -M: Tianshu Qiu <tian.shu.qiu@intel.com>
> L: linux-media@vger.kernel.org
> +M: Sakari Ailus <sakari.ailus@linux.intel.com>
> S: Maintained
> T: git git://linuxtv.org/media.git
> F: Documentation/devicetree/bindings/media/i2c/asahi-kasei,ak7375.yaml
> @@ -13042,9 +13042,7 @@ F: drivers/iommu/intel/
> INTEL IPU3 CSI-2 CIO2 DRIVER
> M: Yong Zhi <yong.zhi@intel.com>
> M: Sakari Ailus <sakari.ailus@linux.intel.com>
> -M: Bingbu Cao <bingbu.cao@intel.com>
> M: Dan Scally <dan.scally@ideasonboard.com>
> -R: Tianshu Qiu <tian.shu.qiu@intel.com>
> L: linux-media@vger.kernel.org
> S: Maintained
> T: git git://linuxtv.org/media.git
> @@ -13053,8 +13051,6 @@ F: drivers/media/pci/intel/ipu3/
>
> INTEL IPU3 CSI-2 IMGU DRIVER
> M: Sakari Ailus <sakari.ailus@linux.intel.com>
> -R: Bingbu Cao <bingbu.cao@intel.com>
> -R: Tianshu Qiu <tian.shu.qiu@intel.com>
> L: linux-media@vger.kernel.org
> S: Maintained
> F: Documentation/admin-guide/media/ipu3.rst
> @@ -13064,8 +13060,6 @@ F: drivers/staging/media/ipu3/
>
> INTEL IPU6 INPUT SYSTEM DRIVER
> M: Sakari Ailus <sakari.ailus@linux.intel.com>
> -M: Bingbu Cao <bingbu.cao@intel.com>
> -R: Tianshu Qiu <tian.shu.qiu@intel.com>
> L: linux-media@vger.kernel.org
> S: Maintained
> T: git git://linuxtv.org/media.git
> @@ -13074,7 +13068,6 @@ F: drivers/media/pci/intel/ipu6/
>
> INTEL IPU7 INPUT SYSTEM DRIVER
> M: Sakari Ailus <sakari.ailus@linux.intel.com>
> -R: Bingbu Cao <bingbu.cao@intel.com>
> L: linux-media@vger.kernel.org
> S: Maintained
> T: git git://linuxtv.org/media.git
> @@ -13376,7 +13369,6 @@ F: drivers/net/wireless/intel/iwlwifi/
>
> INTEL VISION SENSING CONTROLLER DRIVER
> M: Sakari Ailus <sakari.ailus@linux.intel.com>
> -R: Bingbu Cao <bingbu.cao@intel.com>
> R: Lixu Zhang <lixu.zhang@intel.com>
> L: linux-media@vger.kernel.org
> S: Maintained
> @@ -19657,7 +19649,8 @@ F: Documentation/devicetree/bindings/media/i2c/ovti,os05b10.yaml
> F: drivers/media/i2c/os05b10.c
>
> OMNIVISION OV01A10 SENSOR DRIVER
> -M: Bingbu Cao <bingbu.cao@intel.com>
> +M: Bingbu Cao <bingbu.cao@amd.com>
> +M: Sakari Ailus <sakari.ailus@linux.intel.com>
> L: linux-media@vger.kernel.org
> S: Maintained
> T: git git://linuxtv.org/media.git
> @@ -19750,9 +19743,8 @@ F: Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml
> F: drivers/media/i2c/ov2735.c
>
> OMNIVISION OV2740 SENSOR DRIVER
> -M: Tianshu Qiu <tian.shu.qiu@intel.com>
> -R: Sakari Ailus <sakari.ailus@linux.intel.com>
> -R: Bingbu Cao <bingbu.cao@intel.com>
> +M: Sakari Ailus <sakari.ailus@linux.intel.com>
> +R: Bingbu Cao <bingbu.cao@amd.com>
> L: linux-media@vger.kernel.org
> S: Maintained
> T: git git://linuxtv.org/media.git
> @@ -19894,9 +19886,9 @@ F: Documentation/devicetree/bindings/media/i2c/ovti,ov9650.txt
> F: drivers/media/i2c/ov9650.c
>
> OMNIVISION OV9734 SENSOR DRIVER
> -M: Tianshu Qiu <tian.shu.qiu@intel.com>
> -R: Bingbu Cao <bingbu.cao@intel.com>
> L: linux-media@vger.kernel.org
> +M: Sakari Ailus <sakari.ailus@linux.intel.com>
> +R: Bingbu Cao <bingbu.cao@amd.com>
> S: Maintained
> T: git git://linuxtv.org/media.git
> F: drivers/media/i2c/ov9734.c
> @@ -24912,7 +24904,8 @@ F: Documentation/devicetree/bindings/media/i2c/sony,imx296.yaml
> F: drivers/media/i2c/imx296.c
>
> SONY IMX319 SENSOR DRIVER
> -M: Bingbu Cao <bingbu.cao@intel.com>
> +M: Bingbu Cao <bingbu.cao@amd.com>
> +M: Sakari Ailus <sakari.ailus@linux.intel.com>
> L: linux-media@vger.kernel.org
> S: Maintained
> T: git git://linuxtv.org/media.git
> @@ -24934,7 +24927,9 @@ F: Documentation/devicetree/bindings/media/i2c/sony,imx335.yaml
> F: drivers/media/i2c/imx335.c
>
> SONY IMX355 SENSOR DRIVER
> -M: Tianshu Qiu <tian.shu.qiu@intel.com>
> +M: Sakari Ailus <sakari.ailus@linux.intel.com>
> +M: Dave Stevenson <dave.stevenson@raspberrypi.com>
> +R: David Heidelberg <david@ixit.cz>
> L: linux-media@vger.kernel.org
> S: Maintained
> T: git git://linuxtv.org/media.git
> --
> 2.47.3
>
^ permalink raw reply
* Re: [PATCH 1/2] staging: octeon: add missing tasklet_kill in cvm_oct_tx_shutdown
From: Dan Carpenter @ 2026-06-15 9:10 UTC (permalink / raw)
To: Ayush Mukkanwar
Cc: gregkh, linux-staging, linux-kernel, linux-kernel-mentees, skhan
In-Reply-To: <CABJ81biRz2J7AJbo8xZ9TbmwAT8E7x0kdQP4-W2e3XZ729qWRQ@mail.gmail.com>
On Mon, Jun 15, 2026 at 02:38:53PM +0530, Ayush Mukkanwar wrote:
> Thanks for the feedback, Dan.
> Sashiko found these existing bugs in the octeon driver when it
> reviewed my older patches on octeon.
> I will include the required details in the next version of the patch.
Thanks, this is really useful information. In that case, you need
a Reported-by tag an a link to the Sashiko report.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 1/2] staging: octeon: add missing tasklet_kill in cvm_oct_tx_shutdown
From: Ayush Mukkanwar @ 2026-06-15 9:08 UTC (permalink / raw)
To: Dan Carpenter
Cc: gregkh, linux-staging, linux-kernel, linux-kernel-mentees, skhan
In-Reply-To: <ai-1ZsF3dzqXZcbJ@stanley.mountain>
Thanks for the feedback, Dan.
Sashiko found these existing bugs in the octeon driver when it
reviewed my older patches on octeon.
I will include the required details in the next version of the patch.
On Mon, Jun 15, 2026 at 1:48 PM Dan Carpenter <error27@gmail.com> wrote:
>
> On Sun, Jun 14, 2026 at 05:17:38PM +0530, Ayush Mukkanwar wrote:
> > The TX cleanup tasklet can be scheduled by the watchdog IRQ handler
> > to execute cvm_oct_tx_do_cleanup. There can be a pending tasklet in
> > the queue which might run after the cvm_oct_remove() frees net_device
> > structures, causing a use-after-free in cvm_oct_tx_do_cleanup() as it
> > iterates cvm_oct_device[] which is an array of netdevice pointers.
> > Add tasklet_kill() after free_irq() to ensure the tasklet is no longer
> > scheduled or running before teardown proceeds.
> >
> > Signed-off-by: Ayush Mukkanwar <ayushmukkanwar@gmail.com>
> > ---
>
> Looks good. A couple process though.
>
> 1. It needs a Fixes tags.
>
> 2. You need to say when you are using AI. I think you're supposed to
> say which AI tool you are using as well.
>
> 3. You need to say that the patch has not been tested.
>
> regards,
> dan carpenter
>
^ permalink raw reply
* Re: [PATCH v2] staging: rtl8723bs: Fix missing spaces around operators
From: Dan Carpenter @ 2026-06-15 8:28 UTC (permalink / raw)
To: Moksh Panicker; +Cc: gregkh, linux-staging, linux-kernel, skhan, dan.carpenter
In-Reply-To: <20260615082538.12007-1-mokshpanicker.7@gmail.com>
On Mon, Jun 15, 2026 at 08:25:38AM +0000, Moksh Panicker wrote:
> Add missing spaces around arithmetic and bitwise operators ('+', '-',
> '&') in the rtl8723bs staging driver across multiple files. These were
> flagged by checkpatch.pl with:
>
> CHECK: spaces preferred around that 'X' (ctx:VxV)
>
> Signed-off-by: Moksh Panicker <mokshpanicker.7@gmail.com>
> ---
Thanks!
Reviewed-by: Dan Carpenter <error27@gmail.com>
regards,
dan carpenter
^ permalink raw reply
* [PATCH v2] staging: rtl8723bs: Fix missing spaces around operators
From: Moksh Panicker @ 2026-06-15 8:25 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, skhan, dan.carpenter, Moksh Panicker
Add missing spaces around arithmetic and bitwise operators ('+', '-',
'&') in the rtl8723bs staging driver across multiple files. These were
flagged by checkpatch.pl with:
CHECK: spaces preferred around that 'X' (ctx:VxV)
Signed-off-by: Moksh Panicker <mokshpanicker.7@gmail.com>
---
drivers/staging/rtl8723bs/hal/HalPhyRf.c | 8 ++++----
drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c | 6 +++---
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 2 +-
drivers/staging/rtl8723bs/hal/hal_sdio.c | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf.c b/drivers/staging/rtl8723bs/hal/HalPhyRf.c
index 7bef05a9a..254bfef54 100644
--- a/drivers/staging/rtl8723bs/hal/HalPhyRf.c
+++ b/drivers/staging/rtl8723bs/hal/HalPhyRf.c
@@ -220,13 +220,13 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter)
pDM_Odm->RFCalibrateInfo.OFDM_index[p];
/* 4 7.1 Handle boundary conditions of index. */
- if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] > c.SwingTableSize_OFDM-1)
- pDM_Odm->RFCalibrateInfo.OFDM_index[p] = c.SwingTableSize_OFDM-1;
+ if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] > c.SwingTableSize_OFDM - 1)
+ pDM_Odm->RFCalibrateInfo.OFDM_index[p] = c.SwingTableSize_OFDM - 1;
else if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] < OFDM_min_index)
pDM_Odm->RFCalibrateInfo.OFDM_index[p] = OFDM_min_index;
}
- if (pDM_Odm->RFCalibrateInfo.CCK_index > c.SwingTableSize_CCK-1)
- pDM_Odm->RFCalibrateInfo.CCK_index = c.SwingTableSize_CCK-1;
+ if (pDM_Odm->RFCalibrateInfo.CCK_index > c.SwingTableSize_CCK - 1)
+ pDM_Odm->RFCalibrateInfo.CCK_index = c.SwingTableSize_CCK - 1;
/* else if (pDM_Odm->RFCalibrateInfo.CCK_index < 0) */
/* pDM_Odm->RFCalibrateInfo.CCK_index = 0; */
} else {
diff --git a/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c b/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
index 86404b5e6..98a3d7695 100644
--- a/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
+++ b/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
@@ -88,7 +88,7 @@ u8 HalPwrSeqCmdParsing(
value &= (~(GET_PWR_CFG_MASK(PwrCfgCmd)));
value |= (
GET_PWR_CFG_VALUE(PwrCfgCmd)
- &GET_PWR_CFG_MASK(PwrCfgCmd)
+ & GET_PWR_CFG_MASK(PwrCfgCmd)
);
/* Write the value back to system register */
@@ -106,7 +106,7 @@ u8 HalPwrSeqCmdParsing(
else
value = rtw_read8(padapter, offset);
- value = value&GET_PWR_CFG_MASK(PwrCfgCmd);
+ value = value & GET_PWR_CFG_MASK(PwrCfgCmd);
if (
value == (GET_PWR_CFG_VALUE(PwrCfgCmd) &
GET_PWR_CFG_MASK(PwrCfgCmd))
@@ -126,7 +126,7 @@ u8 HalPwrSeqCmdParsing(
if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
udelay(GET_PWR_CFG_OFFSET(PwrCfgCmd));
else
- udelay(GET_PWR_CFG_OFFSET(PwrCfgCmd)*1000);
+ udelay(GET_PWR_CFG_OFFSET(PwrCfgCmd) * 1000);
break;
case PWR_CMD_END:
diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index bdd595a99..5e2f4131c 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -459,7 +459,7 @@ u8 PHY_GetTxPowerIndexBase(
{
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
u8 txPower = 0;
- u8 chnlIdx = (Channel-1);
+ u8 chnlIdx = (Channel - 1);
if (HAL_IsLegalChannel(padapter, Channel) == false)
chnlIdx = 0;
diff --git a/drivers/staging/rtl8723bs/hal/hal_sdio.c b/drivers/staging/rtl8723bs/hal/hal_sdio.c
index 665c85ecc..1d29245da 100644
--- a/drivers/staging/rtl8723bs/hal/hal_sdio.c
+++ b/drivers/staging/rtl8723bs/hal/hal_sdio.c
@@ -24,7 +24,7 @@ u8 rtw_hal_sdio_query_tx_freepage(
{
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
- if ((pHalData->SdioTxFIFOFreePage[PageIdx]+pHalData->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX]) >= (RequiredPageNum))
+ if ((pHalData->SdioTxFIFOFreePage[PageIdx] + pHalData->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX]) >= (RequiredPageNum))
return true;
else
return false;
--
2.34.1
^ permalink raw reply related
* Re: [PATCH 1/2] staging: octeon: add missing tasklet_kill in cvm_oct_tx_shutdown
From: Dan Carpenter @ 2026-06-15 8:18 UTC (permalink / raw)
To: Ayush Mukkanwar
Cc: gregkh, linux-staging, linux-kernel, linux-kernel-mentees, skhan
In-Reply-To: <20260614114739.87061-1-ayushmukkanwar@gmail.com>
On Sun, Jun 14, 2026 at 05:17:38PM +0530, Ayush Mukkanwar wrote:
> The TX cleanup tasklet can be scheduled by the watchdog IRQ handler
> to execute cvm_oct_tx_do_cleanup. There can be a pending tasklet in
> the queue which might run after the cvm_oct_remove() frees net_device
> structures, causing a use-after-free in cvm_oct_tx_do_cleanup() as it
> iterates cvm_oct_device[] which is an array of netdevice pointers.
> Add tasklet_kill() after free_irq() to ensure the tasklet is no longer
> scheduled or running before teardown proceeds.
>
> Signed-off-by: Ayush Mukkanwar <ayushmukkanwar@gmail.com>
> ---
Looks good. A couple process though.
1. It needs a Fixes tags.
2. You need to say when you are using AI. I think you're supposed to
say which AI tool you are using as well.
3. You need to say that the patch has not been tested.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] staging: greybus: Remove unused macro
From: Greg KH @ 2026-06-15 7:56 UTC (permalink / raw)
To: Michail Tatas
Cc: pure.logic, johan, elder, greybus-dev, linux-staging,
linux-kernel
In-Reply-To: <ahdNZlYqnTO22tQq@michalis-linux>
On Wed, May 27, 2026 at 11:00:38PM +0300, Michail Tatas wrote:
> Remove unused macro as indicated by the compiler
> when building with make W=2
W=2 even works for staging drivers? I wouldn't worry about that at all :)
> Signed-off-by: Michail Tatas <michail.tatas@gmail.com>
> ---
> drivers/staging/greybus/loopback.c | 26 --------------------------
> 1 file changed, 26 deletions(-)
>
> diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
> index 4d085d3cd471..7442b1c4e86c 100644
> --- a/drivers/staging/greybus/loopback.c
> +++ b/drivers/staging/greybus/loopback.c
> @@ -167,32 +167,6 @@ static DEVICE_ATTR_RO(name##_avg)
> gb_loopback_ro_stats_attr(field, max, u); \
> gb_loopback_ro_avg_attr(field)
>
> -#define gb_loopback_attr(field, type) \
> -static ssize_t field##_show(struct device *dev, \
> - struct device_attribute *attr, \
> - char *buf) \
> -{ \
> - struct gb_loopback *gb = dev_get_drvdata(dev); \
> - return sysfs_emit(buf, "%" #type "\n", gb->field); \
> -} \
> -static ssize_t field##_store(struct device *dev, \
> - struct device_attribute *attr, \
> - const char *buf, \
> - size_t len) \
> -{ \
> - int ret; \
> - struct gb_loopback *gb = dev_get_drvdata(dev); \
> - mutex_lock(&gb->mutex); \
> - ret = sscanf(buf, "%"#type, &gb->field); \
> - if (ret != 1) \
> - len = -EINVAL; \
> - else \
> - gb_loopback_check_attr(gb, bundle); \
> - mutex_unlock(&gb->mutex); \
> - return len; \
> -} \
> -static DEVICE_ATTR_RW(field)
I see why this is present, it makes it more uniform. That being said,
as it's not being used anywhere, I can understand the confusion even if
there is not any produced code difference at all.
I'll queue this up after -rc1 is out.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] staging: greybus: camera: remove broken camera driver
From: gregkh @ 2026-06-15 7:53 UTC (permalink / raw)
To: Ashwin Gundarapu; +Cc: linux-kernel, linux-staging
In-Reply-To: <19e6eb80318.39c60cbc208598.4490466986425288169@zohomail.in>
On Thu, May 28, 2026 at 06:43:33PM +0530, Ashwin Gundarapu wrote:
> The Greybus camera driver has been non-functional since its inclusion
> due to a missing greybus_protocols.h header and reliance on deprecated
> v4l2_mbus_pixelcode enum.
>
> The Project Ara hardware this driver was written for never shipped,
> and the driver has seen no real fixes in over 8 years—only treewide
> cleanups such as GFP_KERNEL conversions and debugfs error handling
> changes.
>
> Remove the entire camera driver (~2,000 lines).
>
> Signed-off-by: Ashwin Gundarapu <linuxuser509@zohomail.in>
> ---
> drivers/staging/greybus/camera.c | 1047 ---------------------------
> drivers/staging/greybus/gb-camera.h | 127 ----
> 2 files changed, 1174 deletions(-)
> delete mode 100644 drivers/staging/greybus/camera.c
> delete mode 100644 drivers/staging/greybus/gb-camera.h
You forgot to delete this from the build and configuration at the same
time :(
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH 4/4] staging: rtl8723bs: convert update_attrib to return errno
From: Dan Carpenter @ 2026-06-15 7:43 UTC (permalink / raw)
To: Hungyu Lin; +Cc: gregkh, linux-staging, linux-kernel
In-Reply-To: <20260614182309.96110-5-dennylin0707@gmail.com>
On Sun, Jun 14, 2026 at 06:23:09PM +0000, Hungyu Lin wrote:
> Convert update_attrib() to return 0 on success and a
> negative errno on failure. Update rtw_xmit() to handle
> the returned error code.
>
> No functional change intended.
>
> Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index b6d9332958f5..fb2fd3f5de77 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -741,17 +741,17 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
Change this to int as well.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 3/4] staging: rtl8723bs: convert update_attrib_sec_info to return errno
From: Dan Carpenter @ 2026-06-15 7:42 UTC (permalink / raw)
To: Hungyu Lin; +Cc: gregkh, linux-staging, linux-kernel
In-Reply-To: <20260614182309.96110-4-dennylin0707@gmail.com>
On Sun, Jun 14, 2026 at 06:23:08PM +0000, Hungyu Lin wrote:
> Convert update_attrib_sec_info() to return 0 on success and
> a negative errno on failure. Update update_attrib() to
> propagate the returned error code.
>
> No functional change intended.
>
> Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index 7d10caf8cbfe..b6d9332958f5 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -519,7 +519,7 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
^^^
Change this to int. I wouldn't have commented on this except for the
change to update_attrib()...
> pattrib->encrypt = 0;
>
> if ((pattrib->ether_type != 0x888e) && !check_fwstate(pmlmepriv, WIFI_MP_STATE))
> - return _FAIL;
> + return -EINVAL;
> } else {
> GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast);
>
> @@ -558,7 +558,7 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
> pattrib->icv_len = 4;
>
> if (psecuritypriv->busetkipkey == _FAIL)
> - return _FAIL;
> + return -EINVAL;
>
> if (bmcast)
> TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
> @@ -596,7 +596,7 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
> else
> pattrib->bswenc = false;
>
> - return _SUCCESS;
> + return 0;
> }
>
> u8 qos_acm(u8 acm_mask, u8 priority)
> @@ -754,9 +754,10 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
> return _FAIL;
>
> spin_lock_bh(&psta->lock);
> - if (update_attrib_sec_info(padapter, pattrib, psta) == _FAIL) {
> + ret = update_attrib_sec_info(padapter, pattrib, psta);
> + if (ret) {
> spin_unlock_bh(&psta->lock);
> - return _FAIL;
> + return ret;
This should have stayed as _FAIL and then been updated in the next
patch. It doesn't break anything, but lets still do it that way.
Let's never mix _FAIL and standard error codes.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH v2] staging: greybus: audio: check sscanf() result directly
From: nasser @ 2026-06-15 7:40 UTC (permalink / raw)
To: Dan Carpenter
Cc: Vaibhav Agarwal, Mark Greer, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, greybus-dev, linux-staging, linux-kernel,
kernel test robot
In-Reply-To: <ai-n7jNPT862Wscj@stanley.mountain>
Hi Dan,
Thanks a lot for the explanation and the valuable information. I will
definitely take your advice, learn from this, and focus on tackling
more important issues going forward.
Best regards,
Abdelnasser
On Mon, Jun 15, 2026 at 10:21 AM Dan Carpenter <error27@gmail.com> wrote:
>
> On Sun, Jun 14, 2026 at 09:08:57AM +0300, abdelnasser hussein wrote:
> > Smatch warns:
> >
> > drivers/staging/greybus/audio_codec.c:335 gbaudio_module_update()
> > warn: sscanf doesn't return error codes
> >
> > sscanf() returns the number of successfully matched input items, not a
> > negative error code. Compare the return value directly with the expected
> > number of conversions instead of storing it in ret as an error code.
> >
> > Also remove the redundant else-if check for snd_soc_dapm_aif_out. The
> > widget id is validated earlier in the function, so the remaining branch
> > can only handle snd_soc_dapm_aif_out. This avoids a compiler warning
> > about a potentially uninitialized variable.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202606140347.gGVWDnbi-lkp@intel.com/
> >
> > Signed-off-by: abdelnasser hussein <abdelnasserhussein11@gmail.com>
> > ---
>
> This static checker warning is triggered when we propagate the return
> from sscanf().
>
> > drivers/staging/greybus/audio_codec.c | 5 ++---
> > 1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> > index 720aa752e17e..6daa4e706792 100644
> > --- a/drivers/staging/greybus/audio_codec.c
> > +++ b/drivers/staging/greybus/audio_codec.c
> > @@ -311,8 +311,7 @@ int gbaudio_module_update(struct gbaudio_codec_info *codec,
> > }
> >
> > /* parse dai_id from AIF widget's stream_name */
> > - ret = sscanf(w->sname, "%s %d %s", intf_name, &dai_id, dir);
> > - if (ret < 3) {
> > + if (sscanf(w->sname, "%s %d %s", intf_name, &dai_id, dir) != 3) {
> > dev_err(codec->dev, "Error while parsing dai_id for %s\n", w->name);
> > return -EINVAL;
>
> So this code is fine as-is since it's returning -EINVAL.
>
> > }
> > @@ -323,7 +322,7 @@ int gbaudio_module_update(struct gbaudio_codec_info *codec,
> > ret = gbaudio_module_enable_tx(codec, module, dai_id);
> > else
> > ret = gbaudio_module_disable_tx(module, dai_id);
> > - } else if (w->id == snd_soc_dapm_aif_out) {
> > + } else {
>
> Yes, this is what the static checker is complaining about. It thinks
> that the if statement might be false. But to a human reader, the
> else if or the plain else are equivalent. It's just a style choice
> which way to write it.
>
> I would just leave this as-is since the original code is fine. To be
> honest, most old static checker warnings are stuff that someone
> already decided to leave as is.
>
> It's better to write new checks. Just look for simple fixes in git
> log and then you can vibe code a check. Better to work against the
> devel branch of smatch.
>
> regards,
> dan carpenter
>
> > if (enable)
> > ret = gbaudio_module_enable_rx(codec, module, dai_id);
> > else
>
>
^ permalink raw reply
* Re: [PATCH v3 1/2] staging: greybus: audio_codec: fix sscanf return value check
From: Dan Carpenter @ 2026-06-15 7:35 UTC (permalink / raw)
To: Abdelnasser Hussein
Cc: gregkh, vaibhav.sr, mgreer, johan, elder, greybus-dev,
linux-staging, linux-kernel, Dan Carpenter
In-Reply-To: <20260614154329.5176-2-abdelnasserhussein11@gmail.com>
On Sun, Jun 14, 2026 at 06:43:28PM +0300, Abdelnasser Hussein wrote:
> Smatch static checker warns:
> drivers/staging/greybus/audio_codec.c:335 gbaudio_module_update()
> warn: sscanf doesn't return error codes
>
> The sscanf() function returns the number of successfully matched input
> items, not a negative error code. Compare the return value directly
> with the expected number of conversions (3) instead of storing it in
> 'ret' and returning it as an error code, which leads to returning
> a positive value on failure.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Closes: https://lore.kernel.org/all/YoOLnDkHgVltyXK7@kili/
>
> Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
There shouldn't be a blank line in the middle of the tags
block.
The closes tag isn't right...
https://lore.kernel.org/all/202103080429.X31wogmF-lkp@intel.com/
Sorry, this stuff is a bit confusing to everyone who is not involved
with the zero day bot. What happens is that for some warnings, they
first send the warning to me and I look it over and decide whether or
not it's valid. In this case, I decided it wasn't valid. Sure, I can
understand why the static checker thinks we're propagating the return
from sscanf() but actually the second else if is always true.
(I haven't actually checked that btw, I'm just assuming that the
second else if is always true. Static analysis is always a best
effort type of thing).
regards,
dan carpenter
^ permalink raw reply
* [PATCH v2 2/2] media: atomisp: fix memory leak in atomisp_csi2_bridge_parse_firmware()
From: Dawei Feng @ 2026-06-15 7:28 UTC (permalink / raw)
To: andy
Cc: error27, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, linux-kernel, linux-media, linux-staging,
jianhao.xu, Dawei Feng, Zilin Guan
In-Reply-To: <20260615072841.3113700-1-dawei.feng@seu.edu.cn>
atomisp_csi2_bridge_parse_firmware() initializes isp->notifier and may
allocate async notifier connections via v4l2_async_nf_add_fwnode_remote().
However, these resources are currently leaked if a subsequent entity
registration or probe step fails, or when the driver is removed.
Fix this by introducing dedicated helpers to clean up and unregister the
async notifier state. Call atomisp_notifier_cleanup() to release the
allocated connections in both the entity registration failure path and the
overall probe unwind path.
Additionally, invoke atomisp_notifier_unregister() during the device
remove path to ensure the notifier is properly unregistered from the V4L2
core before its underlying resources are freed.
Fixes: 8d28ec7e9145 ("media: atomisp: Add support for v4l2-async sensor registration")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
---
drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 5ba9584b81d7..1073d9e5eafb 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -798,6 +798,17 @@ static int atomisp_subdev_probe(struct atomisp_device *isp)
return atomisp_csi_lane_config(isp);
}
+static void atomisp_notifier_cleanup(struct atomisp_device *isp)
+{
+ v4l2_async_nf_cleanup(&isp->notifier);
+}
+
+static void atomisp_notifier_unregister(struct atomisp_device *isp)
+{
+ v4l2_async_nf_unregister(&isp->notifier);
+ atomisp_notifier_cleanup(isp);
+}
+
static void atomisp_unregister_entities(struct atomisp_device *isp)
{
unsigned int i;
@@ -869,6 +880,7 @@ static int atomisp_register_entities(struct atomisp_device *isp)
for (i = 0; i < ATOMISP_CAMERA_NR_PORTS; i++)
atomisp_mipi_csi2_unregister_entities(&isp->csi2_port[i]);
csi_and_subdev_probe_failed:
+ atomisp_notifier_cleanup(isp);
v4l2_device_unregister(&isp->v4l2_dev);
v4l2_device_failed:
media_device_unregister(&isp->media_dev);
@@ -1444,6 +1456,7 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
devm_free_irq(&pdev->dev, pdev->irq, isp);
error_unregister_entities:
hmm_cleanup();
+ atomisp_notifier_cleanup(isp);
atomisp_unregister_entities(isp);
error_uninitialize_modules:
atomisp_uninitialize_modules(isp);
@@ -1471,6 +1484,7 @@ static void atomisp_pci_remove(struct pci_dev *pdev)
devm_free_irq(&pdev->dev, pdev->irq, isp);
hmm_cleanup();
+ atomisp_notifier_unregister(isp);
atomisp_unregister_entities(isp);
atomisp_uninitialize_modules(isp);
media_device_cleanup(&isp->media_dev);
--
2.34.1
^ permalink raw reply related
* [PATCH v2 0/2] media: atomisp: fix probe memory leaks
From: Dawei Feng @ 2026-06-15 7:28 UTC (permalink / raw)
To: andy
Cc: error27, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, linux-kernel, linux-media, linux-staging,
jianhao.xu, Dawei Feng
This series fixes two memory leaks in the atomisp PCI probe and adjusts
cleanup paths.
Patch 1 fixes the cleanup boundary for media entities created during
module initialization. atomisp_uninitialize_modules() did not release all
module-owned state and instead left some media entity cleanup to unregister
helpers. That split is incomplete for probe failures that happen after
module initialization but before all entities are registered, so the
module cleanup path now owns the corresponding media entity cleanup.
Patch 2 adds cleanup for the V4L2 async notifier state initialized by
atomisp_csi2_bridge_parse_firmware(), including notifier connection
cleanup on probe failures and notifier unregister on remove.
Changes in v2:
- Rework patch 1 around the module-init cleanup ownership boundary and
move media_device_cleanup() after module cleanup.
- Add async notifier cleanup as patch 2.
Dawei Feng (2):
media: atomisp: fix memory leak in atomisp_pci_probe()
media: atomisp: fix memory leak in
atomisp_csi2_bridge_parse_firmware()
.../staging/media/atomisp/pci/atomisp_csi2.c | 5 +++-
.../media/atomisp/pci/atomisp_subdev.c | 9 +++++--
.../staging/media/atomisp/pci/atomisp_v4l2.c | 26 ++++++++++++++-----
3 files changed, 30 insertions(+), 10 deletions(-)
--
2.34.1
^ permalink raw reply
* [PATCH v2 1/2] media: atomisp: fix memory leak in atomisp_pci_probe()
From: Dawei Feng @ 2026-06-15 7:28 UTC (permalink / raw)
To: andy
Cc: error27, hansg, mchehab, sakari.ailus, gregkh,
abdelrahmanfekry375, linux-kernel, linux-media, linux-staging,
jianhao.xu, Dawei Feng, Zilin Guan
In-Reply-To: <20260615072841.3113700-1-dawei.feng@seu.edu.cn>
atomisp_initialize_modules() creates CSI2 and ISP subdev media entities
before atomisp_pci_probe() registers them. Its counterpart,
atomisp_uninitialize_modules(), only releases part of that module-owned
state and leaves some media entity cleanup to the entity unregister path.
That ownership split is incomplete for probe error paths. If
atomisp_pci_probe() fails after module initialization but before all
entities are registered, the unwind path cannot rely on unregister
helpers to release media entity state whose lifetime started in module
initialization. The CSI2 and ISP subdev media entities can therefore be
left allocated.
Refactor the cleanup boundary so module cleanup releases media entities
created by module initialization, while unregister helpers only undo
registered V4L2 and media device state. Move CSI2 and ISP subdev media
entity cleanup into atomisp_mipi_csi2_cleanup() and the new
atomisp_subdev_cleanup(), and run media_device_cleanup() after module
cleanup in the probe unwind and remove paths.
If atomisp_mipi_csi2_init() itself fails, it has already unwound its
partial setup, so return the error directly. Only the later
atomisp_subdev_init() failure path needs to clean up CSI2 from the
caller.
The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing
v6.13-rc1. The tool is still under development and is not yet publicly
available. Manual inspection confirms that the bug is still present in
v7.1-rc7.
An x86_64 allyesconfig build showed no new warnings. As we do not have
an Intel Atom ISP platform with the required camera sensor hardware to
test with, no runtime testing was able to be performed.
Fixes: 9d4fa1a16b28 ("media: atomisp: cleanup directory hierarchy")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
---
drivers/staging/media/atomisp/pci/atomisp_csi2.c | 5 ++++-
drivers/staging/media/atomisp/pci/atomisp_subdev.c | 9 +++++++--
drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 12 +++++-------
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2.c b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
index 95b9113d75e9..2a85d04ade81 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_csi2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
@@ -185,7 +185,6 @@ static int mipi_csi2_init_entities(struct atomisp_mipi_csi2_device *csi2,
void
atomisp_mipi_csi2_unregister_entities(struct atomisp_mipi_csi2_device *csi2)
{
- media_entity_cleanup(&csi2->subdev.entity);
v4l2_device_unregister_subdev(&csi2->subdev);
}
@@ -331,6 +330,10 @@ void atomisp_csi2_configure(struct atomisp_sub_device *asd)
*/
void atomisp_mipi_csi2_cleanup(struct atomisp_device *isp)
{
+ unsigned int i;
+
+ for (i = 0; i < ATOMISP_CAMERA_NR_PORTS; i++)
+ media_entity_cleanup(&isp->csi2_port[i].subdev.entity);
}
int atomisp_mipi_csi2_init(struct atomisp_device *isp)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
index 3d56ca83ecb7..11d7e04d3ec5 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
@@ -886,11 +886,16 @@ void atomisp_subdev_cleanup_pending_events(struct atomisp_sub_device *asd)
void atomisp_subdev_unregister_entities(struct atomisp_sub_device *asd)
{
- atomisp_subdev_cleanup_entities(asd);
v4l2_device_unregister_subdev(&asd->subdev);
atomisp_video_unregister(&asd->video_out);
}
+void atomisp_subdev_cleanup(struct atomisp_device *isp)
+{
+ atomisp_subdev_cleanup_entities(&isp->asd);
+ media_entity_cleanup(&isp->asd.video_out.vdev.entity);
+}
+
int atomisp_subdev_register_subdev(struct atomisp_sub_device *asd,
struct v4l2_device *vdev)
{
@@ -913,7 +918,7 @@ int atomisp_subdev_init(struct atomisp_device *isp)
isp_subdev_init_params(&isp->asd);
ret = isp_subdev_init_entities(&isp->asd);
if (ret < 0)
- atomisp_subdev_cleanup_entities(&isp->asd);
+ atomisp_subdev_cleanup(isp);
return ret;
}
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 900a67552d6a..5ba9584b81d7 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -334,10 +334,8 @@ int atomisp_video_init(struct atomisp_video_pipe *video)
void atomisp_video_unregister(struct atomisp_video_pipe *video)
{
- if (video_is_registered(&video->vdev)) {
- media_entity_cleanup(&video->vdev.entity);
+ if (video_is_registered(&video->vdev))
video_unregister_device(&video->vdev);
- }
}
static int atomisp_save_iunit_reg(struct atomisp_device *isp)
@@ -814,7 +812,6 @@ static void atomisp_unregister_entities(struct atomisp_device *isp)
v4l2_device_unregister(&isp->v4l2_dev);
media_device_unregister(&isp->media_dev);
- media_device_cleanup(&isp->media_dev);
for (i = 0; i < isp->input_cnt; i++)
__v4l2_subdev_state_free(isp->inputs[i].try_sd_state);
@@ -875,7 +872,6 @@ static int atomisp_register_entities(struct atomisp_device *isp)
v4l2_device_unregister(&isp->v4l2_dev);
v4l2_device_failed:
media_device_unregister(&isp->media_dev);
- media_device_cleanup(&isp->media_dev);
return ret;
}
@@ -1086,7 +1082,7 @@ static int atomisp_initialize_modules(struct atomisp_device *isp)
ret = atomisp_mipi_csi2_init(isp);
if (ret < 0) {
dev_err(isp->dev, "mipi csi2 initialization failed\n");
- goto error_mipi_csi2;
+ return ret;
}
ret = atomisp_subdev_init(isp);
@@ -1098,13 +1094,13 @@ static int atomisp_initialize_modules(struct atomisp_device *isp)
return 0;
error_isp_subdev:
-error_mipi_csi2:
atomisp_mipi_csi2_cleanup(isp);
return ret;
}
static void atomisp_uninitialize_modules(struct atomisp_device *isp)
{
+ atomisp_subdev_cleanup(isp);
atomisp_mipi_csi2_cleanup(isp);
}
@@ -1451,6 +1447,7 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
atomisp_unregister_entities(isp);
error_uninitialize_modules:
atomisp_uninitialize_modules(isp);
+ media_device_cleanup(&isp->media_dev);
error_irq_uninit:
atomisp_msi_irq_uninit(isp);
pci_free_irq_vectors(pdev);
@@ -1476,6 +1473,7 @@ static void atomisp_pci_remove(struct pci_dev *pdev)
atomisp_unregister_entities(isp);
atomisp_uninitialize_modules(isp);
+ media_device_cleanup(&isp->media_dev);
atomisp_msi_irq_uninit(isp);
pci_free_irq_vectors(pdev);
}
--
2.34.1
^ permalink raw reply related
* Re: [PATCH v1 0/4] staging: rtl8723bs: Fix missing spaces around operators
From: Dan Carpenter @ 2026-06-15 7:28 UTC (permalink / raw)
To: Moksh Panicker; +Cc: gregkh, linux-staging, linux-kernel, skhan
In-Reply-To: <20260614122155.20034-1-mokshpanicker.7@gmail.com>
On Sun, Jun 14, 2026 at 12:21:51PM +0000, Moksh Panicker wrote:
> This patch series fixes missing spaces around arithmetic and bitwise
> operators ('+',' -', '&') in the rtl8723bs staging driver. These were
> flagged by checkpatch.pl with:
>
> CHECK: spaces preferred around that 'X' (ctx:VxV)
>
> Each patch addresses one file independently.
>
> Signed-off-by: Moksh Panicker <mokshpanicker.7@gmail.com>
>
> Moksh Panicker (4):
> staging: rtl8723bs: Fix missing space around '+' operator in
> hal_sdio.c
> staging: rtl8723bs: Fix missing space around '-' operator in
> hal_com_phycfg.c
> staging: rtl8723bs: Fix missing spaces around operators in
> HalPwrSeqCmd.c
> staging: rtl8723bs: Fix missing spaces around '-' operator in
> HalPhyRf.c
>
> drivers/staging/rtl8723bs/hal/HalPhyRf.c | 8 ++++----
> drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c | 6 +++---
> drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 2 +-
> drivers/staging/rtl8723bs/hal/hal_sdio.c | 2 +-
> 4 files changed, 9 insertions(+), 9 deletions(-)
Just combine all 4 patches into one patch.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH v1 1/4] staging: rtl8723bs: Fix missing space around '+' operator in hal_sdio.c
From: Dan Carpenter @ 2026-06-15 7:26 UTC (permalink / raw)
To: Moksh Panicker; +Cc: gregkh, linux-staging, linux-kernel, skhan
In-Reply-To: <20260614122155.20034-2-mokshpanicker.7@gmail.com>
On Sun, Jun 14, 2026 at 12:21:52PM +0000, Moksh Panicker wrote:
> Add missing space around the '+' operator in HalQueryTxBufferStatus().
> This fixes the following checkpatch.pl warning:
>
> CHECK: spaces preferred around that '+' (ctx:VxV)
> Signed-off-by: Moksh Panicker <mokshpanicker.7@gmail.com>
There needs to be a blank line before Signing block.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH v2] staging: greybus: audio: check sscanf() result directly
From: Dan Carpenter @ 2026-06-15 7:21 UTC (permalink / raw)
To: abdelnasser hussein
Cc: Vaibhav Agarwal, Mark Greer, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, greybus-dev, linux-staging, linux-kernel,
kernel test robot
In-Reply-To: <20260614060857.15366-1-abdelnasserhussein11@gmail.com>
On Sun, Jun 14, 2026 at 09:08:57AM +0300, abdelnasser hussein wrote:
> Smatch warns:
>
> drivers/staging/greybus/audio_codec.c:335 gbaudio_module_update()
> warn: sscanf doesn't return error codes
>
> sscanf() returns the number of successfully matched input items, not a
> negative error code. Compare the return value directly with the expected
> number of conversions instead of storing it in ret as an error code.
>
> Also remove the redundant else-if check for snd_soc_dapm_aif_out. The
> widget id is validated earlier in the function, so the remaining branch
> can only handle snd_soc_dapm_aif_out. This avoids a compiler warning
> about a potentially uninitialized variable.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202606140347.gGVWDnbi-lkp@intel.com/
>
> Signed-off-by: abdelnasser hussein <abdelnasserhussein11@gmail.com>
> ---
This static checker warning is triggered when we propagate the return
from sscanf().
> drivers/staging/greybus/audio_codec.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index 720aa752e17e..6daa4e706792 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -311,8 +311,7 @@ int gbaudio_module_update(struct gbaudio_codec_info *codec,
> }
>
> /* parse dai_id from AIF widget's stream_name */
> - ret = sscanf(w->sname, "%s %d %s", intf_name, &dai_id, dir);
> - if (ret < 3) {
> + if (sscanf(w->sname, "%s %d %s", intf_name, &dai_id, dir) != 3) {
> dev_err(codec->dev, "Error while parsing dai_id for %s\n", w->name);
> return -EINVAL;
So this code is fine as-is since it's returning -EINVAL.
> }
> @@ -323,7 +322,7 @@ int gbaudio_module_update(struct gbaudio_codec_info *codec,
> ret = gbaudio_module_enable_tx(codec, module, dai_id);
> else
> ret = gbaudio_module_disable_tx(module, dai_id);
> - } else if (w->id == snd_soc_dapm_aif_out) {
> + } else {
Yes, this is what the static checker is complaining about. It thinks
that the if statement might be false. But to a human reader, the
else if or the plain else are equivalent. It's just a style choice
which way to write it.
I would just leave this as-is since the original code is fine. To be
honest, most old static checker warnings are stuff that someone
already decided to leave as is.
It's better to write new checks. Just look for simple fixes in git
log and then you can vibe code a check. Better to work against the
devel branch of smatch.
regards,
dan carpenter
> if (enable)
> ret = gbaudio_module_enable_rx(codec, module, dai_id);
> else
^ permalink raw reply
* Re: [PATCH v2] staging: fbtft: use %pe for backlight errors
From: Andy Shevchenko @ 2026-06-15 7:11 UTC (permalink / raw)
To: Keefe Reeves
Cc: andy, gregkh, abdun.nihaal, error27, chintanlike, namcao,
niejianglei2021, dri-devel, linux-fbdev, linux-staging,
linux-kernel
In-Reply-To: <20260614201551.20542-1-reeveskeefe@gmail.com>
On Sun, Jun 14, 2026 at 11:16 PM Keefe Reeves <reeveskeefe@gmail.com> wrote:
>
> Coccinelle found two places where backlight registration errors are
> printed by passing PTR_ERR() to dev_err().
>
> Use %pe instead so the error pointer can be printed directly. This keeps
> the behavior the same and just makes the error printing cleaner.
Oh, nice! Now
Reviewed-by: Andy Shevchenko <andy@kernel.org>
(for curious ones: you can also see my comment against v1 of this patch).
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox