Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eacd9aa9 authored by Wei Yongjun's avatar Wei Yongjun Committed by Benjamin Gaignard
Browse files

drm: sti: Fix return value check in sti_drm_platform_probe()



In case of error, the function platform_device_register_resndata()
returns ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
parent 5024a2b7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -201,8 +201,8 @@ static int sti_drm_platform_probe(struct platform_device *pdev)
	master = platform_device_register_resndata(dev,
			DRIVER_NAME "__master", -1,
			NULL, 0, NULL, 0);
	if (!master)
		return -EINVAL;
	if (IS_ERR(master))
               return PTR_ERR(master);

	platform_set_drvdata(pdev, master);
	return 0;