From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5029598112398361862==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: [bbrezillon-0day:drm-bridge-busfmt-v4 8/11] drivers/gpu/drm/drm_bridge.c:196:5-11: ERROR: allocation function on line 189 returns NULL not ERR_PTR on failure Date: Wed, 04 Dec 2019 03:32:18 +0800 Message-ID: <201912040317.GP2fReLU%lkp@intel.com> List-Id: --===============5029598112398361862== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://github.com/bbrezillon/linux-0day drm-bridge-busfmt-v4 head: d7ec36aec4ff0b6741ff15cfb1d61f9078a797f7 commit: eef75946f72c81815a43d5f19eecda08a327146e [8/11] drm/bridge: Add a d= rm_bridge_state object If you fix the issue, kindly add following tag Reported-by: kbuild test robot coccinelle warnings: (new ones prefixed by >>) >> drivers/gpu/drm/drm_bridge.c:196:5-11: ERROR: allocation function on lin= e 189 returns NULL not ERR_PTR on failure vim +196 drivers/gpu/drm/drm_bridge.c 134 = 135 /** 136 * drm_bridge_attach - attach the bridge to an encoder's chain 137 * 138 * @encoder: DRM encoder 139 * @bridge: bridge to attach 140 * @previous: previous bridge in the chain (optional) 141 * 142 * Called by a kms driver to link the bridge to an encoder's chain. = The previous 143 * argument specifies the previous bridge in the chain. If NULL, the= bridge is 144 * linked directly at the encoder's output. Otherwise it is linked a= t the 145 * previous bridge's output. 146 * 147 * If non-NULL the previous bridge must be already attached by a cal= l to this 148 * function. 149 * 150 * Note that bridges attached to encoders are auto-detached during e= ncoder 151 * cleanup in drm_encoder_cleanup(), so drm_bridge_attach() should g= enerally 152 * *not* be balanced with a drm_bridge_detach() in driver code. 153 * 154 * RETURNS: 155 * Zero on success, error code on failure 156 */ 157 int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge= *bridge, 158 struct drm_bridge *previous) 159 { 160 struct drm_bridge_state *state; 161 int ret; 162 = 163 if (!encoder || !bridge) 164 return -EINVAL; 165 = 166 if (previous && (!previous->dev || previous->encoder !=3D encoder)) 167 return -EINVAL; 168 = 169 if (bridge->dev) 170 return -EBUSY; 171 = 172 bridge->dev =3D encoder->dev; 173 bridge->encoder =3D encoder; 174 = 175 if (previous) 176 list_add(&bridge->chain_node, &previous->chain_node); 177 else 178 list_add(&bridge->chain_node, &encoder->bridge_chain); 179 = 180 if (bridge->funcs->attach) { 181 ret =3D bridge->funcs->attach(bridge); 182 if (ret < 0) 183 goto err_reset_bridge; 184 } 185 = 186 if (bridge->funcs->atomic_reset) { 187 state =3D bridge->funcs->atomic_reset(bridge); 188 } else { > 189 state =3D kzalloc(sizeof(*state), GFP_KERNEL); 190 if (state) 191 __drm_atomic_helper_bridge_reset(bridge, state); 192 else 193 state =3D ERR_PTR(-ENOMEM); 194 } 195 = > 196 if (IS_ERR(state)) { 197 ret =3D PTR_ERR(state); 198 goto err_detach_bridge; 199 } 200 = 201 drm_atomic_private_obj_init(bridge->dev, &bridge->base, 202 &state->base, 203 &drm_bridge_priv_state_funcs); 204 = 205 return 0; 206 = 207 err_detach_bridge: 208 if (bridge->funcs->detach) 209 bridge->funcs->detach(bridge); 210 = 211 err_reset_bridge: 212 bridge->dev =3D NULL; 213 bridge->encoder =3D NULL; 214 list_del(&bridge->chain_node); 215 return ret; 216 } 217 EXPORT_SYMBOL(drm_bridge_attach); 218 = --- 0-DAY kernel test infrastructure Open Source Technology Cen= ter https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corpor= ation --===============5029598112398361862==--