linux/drivers/staging
Hans de Goede 7b4846b651 media: atomisp: Fix smatch warnings caused by atomisp custom assert() usage
The atomisp code base has a custom assert() macro, a couple of functions
use this in a construction like the following:

   assert(pipe);
   assert(pipe->stream);
   if ((!pipe) || (!pipe->stream)) {
           ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
                               "allocate_mipi_frames(%p) exit: ...\n",
                               pipe);
           return -EINVAL;
   }

The second assert is seen by smatch as dereferencing "pipe" in the above
example (and dereferencing "dvs_6axis_config" in the other case).

Following by the dereferenced variable being checked (a second time)
in the following if () statement.

This triggers the following smatch warnings:
drivers/staging/media/atomisp/pci/sh_css_mipi.c:356 allocate_mipi_frames() warn: variable dereferenced before check 'pipe' (see line 355)
drivers/staging/media/atomisp/pci/sh_css_mipi.c:562 send_mipi_frames() warn: variable dereferenced before check 'pipe' (see line 561)
drivers/staging/media/atomisp/pci/sh_css_param_dvs.c:208 free_dvs_6axis_table() warn: variable dereferenced before check 'dvs_6axis_config' (see line 206)

The custom assert() macro actually expands to a BUG() call and BUG()
calls should not be used in the kernel.

Remove the assert() calls to fix the smatch warnings and in case of
[allocate|send]_mipi_frames() also remove the if () return -EINVAL
block since these functions are never called with a NULL pipe.

Reported-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-08-10 07:58:32 +02:00
..
axis-fifo axis-fifo: remove the unnecessary dev_info() 2023-06-17 16:11:01 +02:00
board
emxx_udc staging: emxx_udc: Convert to platform remove callback returning void 2023-04-03 21:49:54 +02:00
fbtft staging: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:05 +00:00
fieldbus Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
gdm724x net: vlan: introduce skb_vlan_eth_hdr() 2023-04-23 14:16:44 +01:00
greybus Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
iio staging: iio: Switch i2c drivers back to use .probe() 2023-05-28 17:40:36 +01:00
ks7010 staging: ks7010: fix line ending with '(' 2023-03-25 09:47:56 +01:00
media media: atomisp: Fix smatch warnings caused by atomisp custom assert() usage 2023-08-10 07:58:32 +02:00
most staging: most: Switch i2c driver back to use .probe() 2023-05-28 10:15:29 +01:00
nvec staging: nvec_ps2: Convert to platform remove callback returning void 2023-04-03 21:49:55 +02:00
octeon staging: octeon: delete my name from TODO contact 2023-05-08 16:09:33 +02:00
olpc_dcon staging: olpc_dcon: Switch i2c driver back to use .probe() 2023-05-28 10:15:27 +01:00
pi433 staging: pi433: Remove stray gpiod_unexport() call 2023-05-28 15:07:51 +01:00
qlge Staging: qlge: Fix indentation in conditional statement 2023-03-16 09:44:31 +01:00
rtl8192e staging: rtl8192e: Remove whitespace and blank lines 2023-06-23 10:18:27 +02:00
rtl8192u staging: rtl8192u: add '*/' on separate line in block comments 2023-03-28 13:34:49 +02:00
rtl8712 staging: rtl8172: Add blank lines after declarations 2023-04-15 18:04:36 +02:00
rtl8723bs staging: rtl8723bs: Fix blank line issues 2023-06-20 16:13:30 +02:00
rts5208 Staging: rts5208: rtsx: Removed new line in else and else if 2023-06-15 12:46:35 +02:00
sm750fb Staging driver updates for 6.5-rc1 2023-07-03 13:07:13 -07:00
vc04_services staging: vchiq_arm: Remove extra struct vchiq_instance declaration 2023-06-20 16:11:16 +02:00
vme_user Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
vt6655 staging: add HAS_IOPORT dependencies 2023-05-28 10:04:49 +01:00
vt6656 staging: vt6656: remove unused vnt_get_current_tsf() function 2023-03-17 08:07:23 +01:00
wlan-ng drivers: staging: wlan-ng: Remove GPL/MPL boilerplate 2023-05-28 10:14:58 +01:00
Kconfig staging: r8188eu: delete driver 2023-03-09 10:06:28 +01:00
Makefile staging: r8188eu: delete driver 2023-03-09 10:06:28 +01:00