dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Christian Zigotzky <chzigotzky@xenosoft.de>
To: Vivek Kasireddy <vivek.kasireddy@intel.com>,
	dri-devel@lists.freedesktop.org
Cc: Darren Stevens <darren@stevens-zone.net>,
	mad skateman <madskateman@gmail.com>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	"R.T.Dickinson" <rtd2@xtra.co.nz>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Christian Zigotzky <info@xenosoft.de>
Subject: Re: [PATCH] drm/virtio: Fix NULL dereference error in virtio_gpu_poll
Date: Fri, 5 Nov 2021 19:05:22 +0100	[thread overview]
Message-ID: <aa9ce992-e48f-31b4-cc3e-3300bd557dc8@xenosoft.de> (raw)
In-Reply-To: <20211104214249.1802789-1-vivek.kasireddy@intel.com>

On 04 November 2021 at 10:42 pm, Vivek Kasireddy wrote:

 > When virgl is not enabled, vfpriv pointer would not be allocated.
 > Therefore, check for a valid value before dereferencing.
 >
 > Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
 > Cc: Gurchetan Singh <gurchetansingh@chromium.org>
 > Cc: Gerd Hoffmann <kraxel@redhat.com>
 > Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
 > ---
 >  drivers/gpu/drm/virtio/virtgpu_drv.c | 3 ++-
 >  1 file changed, 2 insertions(+), 1 deletion(-)
 >
 > diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c 
b/drivers/gpu/drm/virtio/virtgpu_drv.c
 > index 749db18dcfa2..d86e1ad4a972 100644
 > --- a/drivers/gpu/drm/virtio/virtgpu_drv.c
 > +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
 > @@ -163,10 +163,11 @@ static __poll_t virtio_gpu_poll(struct file *filp,
 >      struct drm_file *drm_file = filp->private_data;
 >      struct virtio_gpu_fpriv *vfpriv = drm_file->driver_priv;
 >      struct drm_device *dev = drm_file->minor->dev;
 > +    struct virtio_gpu_device *vgdev = dev->dev_private;
 >      struct drm_pending_event *e = NULL;
 >      __poll_t mask = 0;
 >
 > -    if (!vfpriv->ring_idx_mask)
 > +    if (!vgdev->has_virgl_3d || !vfpriv || !vfpriv->ring_idx_mask)
 >          return drm_poll(filp, wait);
 >
 >      poll_wait(filp, &drm_file->event_wait, wait);

Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> [1]

[1] https://i.ibb.co/N1vL5Kd/Kernel-5-16-alpha3-Power-PC.png

  reply	other threads:[~2021-11-05 18:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 11:59 Radeon NI: GIT kernel with the nislands_smc commit doesn't boot on a Freescale P5040 board and P.A.Semi Nemo board Christian Zigotzky
2021-04-30 15:26 ` Deucher, Alexander
2021-04-30 15:56   ` Gustavo A. R. Silva
2021-05-06 23:55 ` Gustavo A. R. Silva
2021-05-07  6:43   ` Christian Zigotzky
2021-05-08 11:33     ` Christian Zigotzky
2021-05-09 23:04       ` Gustavo A. R. Silva
2023-11-02 14:45       ` Fbdev issue after the drm updates 'drm-next-2023-10-31-1' Christian Zigotzky
2023-11-07  8:36         ` Christian Zigotzky
2023-11-12 14:23           ` Christian Zigotzky
2023-11-13 12:48             ` Geert Uytterhoeven
2023-11-13 13:12               ` Christian Zigotzky
2023-11-14  9:45               ` Christian Zigotzky
2023-11-15  8:33                 ` Geert Uytterhoeven
2023-11-15  9:22                   ` Gerd Hoffmann
2023-11-16 13:13                     ` Geert Uytterhoeven
2021-11-04 10:45 ` [VirtIO GPU] Xorg doesn't start with the DRM updates 'drm-next-2021-11-03' in a virtual e5500 QEMU KVM-HV machine on a Freescale P5040 board Christian Zigotzky
2021-11-04 21:42   ` [PATCH] drm/virtio: Fix NULL dereference error in virtio_gpu_poll Vivek Kasireddy
2021-11-05 18:05     ` Christian Zigotzky [this message]
2021-11-08 12:56     ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa9ce992-e48f-31b4-cc3e-3300bd557dc8@xenosoft.de \
    --to=chzigotzky@xenosoft.de \
    --cc=darren@stevens-zone.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gurchetansingh@chromium.org \
    --cc=info@xenosoft.de \
    --cc=kraxel@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madskateman@gmail.com \
    --cc=rtd2@xtra.co.nz \
    --cc=vivek.kasireddy@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).