All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/vkms: Fix plane duplicate_state
@ 2018-11-28 10:10 Daniel Vetter
  2018-11-28 21:48 ` Eric Anholt
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2018-11-28 10:10 UTC (permalink / raw
  To: DRI Development
  Cc: Haneen Mohammed, Rodrigo Siqueira, Daniel Vetter, Gustavo Padovan,
	Sean Paul, Daniel Vetter

We need to handle allocation failures and bail out. While at it, tune
the allocation failures down to debug level.

syzbot injected an allocation failure and then hit this WARN_ON.

Reported-by: syzbot+eb6e5365f23c02517dda@syzkaller.appspotmail.com
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
---
 drivers/gpu/drm/vkms/vkms_plane.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index 7041007396ae..e3bcea4b4891 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -23,8 +23,11 @@ vkms_plane_duplicate_state(struct drm_plane *plane)
 		return NULL;
 
 	crc_data = kzalloc(sizeof(*crc_data), GFP_KERNEL);
-	if (WARN_ON(!crc_data))
-		DRM_INFO("Couldn't allocate crc_data");
+	if (!crc_data) {
+		DRM_DEBUG_KMS("Couldn't allocate crc_data\n");
+		kfree(vkms_state);
+		return NULL;
+	}
 
 	vkms_state->crc_data = crc_data;
 
-- 
2.19.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/vkms: Fix plane duplicate_state
  2018-11-28 10:10 [PATCH] drm/vkms: Fix plane duplicate_state Daniel Vetter
@ 2018-11-28 21:48 ` Eric Anholt
  2018-11-29  9:30   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Anholt @ 2018-11-28 21:48 UTC (permalink / raw
  To: DRI Development
  Cc: Haneen Mohammed, Rodrigo Siqueira, Daniel Vetter, Gustavo Padovan,
	Sean Paul, Daniel Vetter


[-- Attachment #1.1: Type: text/plain, Size: 336 bytes --]

Daniel Vetter <daniel.vetter@ffwll.ch> writes:

> We need to handle allocation failures and bail out. While at it, tune
> the allocation failures down to debug level.
>
> syzbot injected an allocation failure and then hit this WARN_ON.

r-b.

I also often don't add kmalloc failure messages, since it's rare and
spits a warning anyway.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/vkms: Fix plane duplicate_state
  2018-11-28 21:48 ` Eric Anholt
@ 2018-11-29  9:30   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2018-11-29  9:30 UTC (permalink / raw
  To: Eric Anholt
  Cc: Haneen Mohammed, Rodrigo Siqueira, Daniel Vetter, DRI Development,
	Gustavo Padovan, Sean Paul, Daniel Vetter

On Wed, Nov 28, 2018 at 01:48:53PM -0800, Eric Anholt wrote:
> Daniel Vetter <daniel.vetter@ffwll.ch> writes:
> 
> > We need to handle allocation failures and bail out. While at it, tune
> > the allocation failures down to debug level.
> >
> > syzbot injected an allocation failure and then hit this WARN_ON.
> 
> r-b.
> 
> I also often don't add kmalloc failure messages, since it's rare and
> spits a warning anyway.

Yeah, just figured I keep it since it's there. Thanks for the review,
pushed.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-11-29  9:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-28 10:10 [PATCH] drm/vkms: Fix plane duplicate_state Daniel Vetter
2018-11-28 21:48 ` Eric Anholt
2018-11-29  9:30   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.