Smatch (Semantic Matching Tool) development
 help / color / mirror / Atom feed
* [SMATCH] Can also be NULL false positive
@ 2026-04-07 16:16 Ethan Tidmore
  2026-04-08  6:47 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Ethan Tidmore @ 2026-04-07 16:16 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: smatch

Hi Dan,

Smatch gives these two warnings: 

drivers/gpu/drm/i915/display/intel_crtc.c:333 __intel_crtc_init() warn: 'primary' can also be NULL
drivers/gpu/drm/i915/display/intel_crtc.c:348 __intel_crtc_init() warn: 'plane' can also be NULL

	if (DISPLAY_VER(display) >= 9)
		primary = skl_universal_plane_create(display, pipe, PLANE_1);
	else
		primary = intel_primary_plane_create(display, pipe);
	if (IS_ERR(primary)) {
		ret = PTR_ERR(primary);
		goto fail;
	}
	crtc->plane_ids_mask |= BIT(primary->id);

and

		if (DISPLAY_VER(display) >= 9)
			plane = skl_universal_plane_create(display, pipe, PLANE_2 + sprite);
		else
			plane = intel_sprite_plane_create(display, pipe, sprite);
		if (IS_ERR(plane)) {
			ret = PTR_ERR(plane);
			goto fail;
		}
		crtc->plane_ids_mask |= BIT(plane->id);

But, this is a false positive because skl_universal_plane_create() and
intel_sprite_plane_create() never return NULL and always error pointers.

Thanks,

ET

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-08 13:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 16:16 [SMATCH] Can also be NULL false positive Ethan Tidmore
2026-04-08  6:47 ` Dan Carpenter
2026-04-08 13:40   ` Ethan Tidmore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox