From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966849AbcA1J2e (ORCPT ); Thu, 28 Jan 2016 04:28:34 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:38142 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934253AbcA1J23 (ORCPT ); Thu, 28 Jan 2016 04:28:29 -0500 Date: Thu, 28 Jan 2016 10:28:38 +0100 From: Daniel Vetter To: Dan Carpenter Cc: David Airlie , Daniel Vetter , Thomas Hellstrom , Alex Deucher , Daniel Stone , Sinclair Yeh , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch] drm/vmwgfx: fix a NULL dereference Message-ID: <20160128092838.GT11240@phenom.ffwll.local> Mail-Followup-To: Dan Carpenter , David Airlie , Thomas Hellstrom , Alex Deucher , Daniel Stone , Sinclair Yeh , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20160128090646.GA5824@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160128090646.GA5824@mwanda> X-Operating-System: Linux phenom 4.3.0-1-amd64 User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 28, 2016 at 12:06:46PM +0300, Dan Carpenter wrote: > We dereference "eaction->event" inside the call to drm_send_event_locked() > so should hold off on setting it to NULL until afterward. > > Fixes: fb740cf2492c ("drm: Create drm_send_event helpers") > Signed-off-by: Dan Carpenter Oh dear that's embarassing. Thanks for the patch, applied. -Daniel > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c > index e0edf14..37c305b 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c > @@ -880,8 +880,8 @@ static void vmw_event_fence_action_seq_passed(struct vmw_fence_action *action) > } > > list_del_init(&eaction->fpriv_head); > - eaction->event = NULL; > drm_send_event_locked(dev, eaction->event); > + eaction->event = NULL; > spin_unlock_irqrestore(&dev->event_lock, irq_flags); > } > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch