[drm-misc:drm-misc-next 25/26] drivers/gpu/drm/bridge/panel.c:367 devm_drm_panel_bridge_add_typed() error: 'bridge' dereferencing possible ERR_PTR()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   941aae3263153cea91cb306cc889951486e16634
commit: 5ea6b17027810ffbdb5bea7d0a2b1d312dd1021c [25/26] drm/panel: Add prepare_prev_first flag to drm_panel
config: nios2-randconfig-m041-20221228
compiler: nios2-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <error27@xxxxxxxxx>

smatch warnings:
drivers/gpu/drm/bridge/panel.c:367 devm_drm_panel_bridge_add_typed() error: 'bridge' dereferencing possible ERR_PTR()

vim +/bridge +367 drivers/gpu/drm/bridge/panel.c

89958b7cd9555a Laurent Pinchart 2019-09-04  348  struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev,
67022227ffb1f5 Eric Anholt      2017-07-18  349  						   struct drm_panel *panel,
67022227ffb1f5 Eric Anholt      2017-07-18  350  						   u32 connector_type)
67022227ffb1f5 Eric Anholt      2017-07-18  351  {
67022227ffb1f5 Eric Anholt      2017-07-18  352  	struct drm_bridge **ptr, *bridge;
67022227ffb1f5 Eric Anholt      2017-07-18  353  
67022227ffb1f5 Eric Anholt      2017-07-18  354  	ptr = devres_alloc(devm_drm_panel_bridge_release, sizeof(*ptr),
67022227ffb1f5 Eric Anholt      2017-07-18  355  			   GFP_KERNEL);
67022227ffb1f5 Eric Anholt      2017-07-18  356  	if (!ptr)
67022227ffb1f5 Eric Anholt      2017-07-18  357  		return ERR_PTR(-ENOMEM);
67022227ffb1f5 Eric Anholt      2017-07-18  358  
89958b7cd9555a Laurent Pinchart 2019-09-04  359  	bridge = drm_panel_bridge_add_typed(panel, connector_type);
67022227ffb1f5 Eric Anholt      2017-07-18  360  	if (!IS_ERR(bridge)) {
67022227ffb1f5 Eric Anholt      2017-07-18  361  		*ptr = bridge;
67022227ffb1f5 Eric Anholt      2017-07-18  362  		devres_add(dev, ptr);
67022227ffb1f5 Eric Anholt      2017-07-18  363  	} else {
67022227ffb1f5 Eric Anholt      2017-07-18  364  		devres_free(ptr);

return -ENOMEM;

67022227ffb1f5 Eric Anholt      2017-07-18  365  	}
67022227ffb1f5 Eric Anholt      2017-07-18  366  
5ea6b17027810f Dave Stevenson   2022-12-05 @367  	bridge->pre_enable_prev_first = panel->prepare_prev_first;
                                                        ^^^^^^^^^^

5ea6b17027810f Dave Stevenson   2022-12-05  368  
67022227ffb1f5 Eric Anholt      2017-07-18  369  	return bridge;
67022227ffb1f5 Eric Anholt      2017-07-18  370  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux