mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
Check pointer for NULL before dereferencing it, not after.
PR: 138383 Submitted by: Patroklos Argyroudis <argp@census-labs.com> Reviewed by: rnoland MFC after: 1 week
This commit is contained in:
parent
4b997c49c0
commit
41d7d5932e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=198332
@ -826,7 +826,7 @@ int mach64_dma_vertex(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
drm_mach64_private_t *dev_priv = dev->dev_private;
|
||||
drm_mach64_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_mach64_sarea_t *sarea_priv;
|
||||
drm_mach64_vertex_t *vertex = data;
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
@ -835,6 +835,7 @@ int mach64_dma_vertex(struct drm_device *dev, void *data,
|
||||
DRM_ERROR("called with no initialization\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
sarea_priv = dev_priv->sarea_priv;
|
||||
|
||||
DRM_DEBUG("pid=%d buf=%p used=%lu discard=%d\n",
|
||||
DRM_CURRENTPID,
|
||||
|
Loading…
Reference in New Issue
Block a user