Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1182192 > unrolled thread

[PATCH] drm/atomic: fix null dereference

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2015-07-11 19:30 +0200
Last post2015-07-11 20:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drm/atomic: fix null dereference Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-07-11 19:30 +0200
    Re: [PATCH] drm/atomic: fix null dereference Rob Clark <robdclark@gmail.com> - 2015-07-11 20:20 +0200

#1182192 — [PATCH] drm/atomic: fix null dereference

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-07-11 19:30 +0200
Subject[PATCH] drm/atomic: fix null dereference
Message-ID<pL6L9-5V0-9@gated-at.bofh.it>
We are checking the size of e->event but we were doing it when e is
known to be NULL.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/gpu/drm/drm_atomic.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index acebd16..51d3a85 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1311,7 +1311,6 @@ static struct drm_pending_vblank_event *create_vblank_event(
 	e = kzalloc(sizeof *e, GFP_KERNEL);
 	if (e == NULL) {
 		spin_lock_irqsave(&dev->event_lock, flags);
-		file_priv->event_space += sizeof e->event;
 		spin_unlock_irqrestore(&dev->event_lock, flags);
 		goto out;
 	}
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1182215

FromRob Clark <robdclark@gmail.com>
Date2015-07-11 20:20 +0200
Message-ID<pL7xv-6pP-3@gated-at.bofh.it>
In reply to#1182192
On Sat, Jul 11, 2015 at 1:24 PM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> We are checking the size of e->event but we were doing it when e is
> known to be NULL.

nak, this will leak event_space..  since it is a sizeof, it isn't
actually deref'ing e, but rather just using the static type info, so
it's ok (although perhaps funny looking)

BR,
-R


> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>  drivers/gpu/drm/drm_atomic.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index acebd16..51d3a85 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1311,7 +1311,6 @@ static struct drm_pending_vblank_event *create_vblank_event(
>         e = kzalloc(sizeof *e, GFP_KERNEL);
>         if (e == NULL) {
>                 spin_lock_irqsave(&dev->event_lock, flags);
> -               file_priv->event_space += sizeof e->event;
>                 spin_unlock_irqrestore(&dev->event_lock, flags);
>                 goto out;
>         }
> --
> 1.8.1.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web