[PATCH] drm: Fix issue reported by Coverity in drivers/char/drm/via_irq.c
This patch tries to fix an issue reported in drivers/char/drm/via_irq.c by Coverity, please review and apply if correct. Error reported: CID: 3444 Checker: REVERSE_INULL (help) File: /export2/p4-coverity/mc2/linux26/drivers/char/drm/via_irq.c Function: via_driver_irq_wait Description: Pointer "dev_priv" dereferenced before NULL check Patch Description: Move de-referencing dev_priv to after the NULL check. Signed-off-by: Jayachandran C. <c.jayachandran at gmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
This commit is contained in:
Родитель
6246b6128b
Коммит
86678dfddb
|
@ -198,7 +198,7 @@ via_driver_irq_wait(drm_device_t * dev, unsigned int irq, int force_sequence,
|
||||||
unsigned int cur_irq_sequence;
|
unsigned int cur_irq_sequence;
|
||||||
drm_via_irq_t *cur_irq = dev_priv->via_irqs;
|
drm_via_irq_t *cur_irq = dev_priv->via_irqs;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
maskarray_t *masks = dev_priv->irq_masks;
|
maskarray_t *masks;
|
||||||
int real_irq;
|
int real_irq;
|
||||||
|
|
||||||
DRM_DEBUG("%s\n", __FUNCTION__);
|
DRM_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
@ -221,7 +221,8 @@ via_driver_irq_wait(drm_device_t * dev, unsigned int irq, int force_sequence,
|
||||||
__FUNCTION__, irq);
|
__FUNCTION__, irq);
|
||||||
return DRM_ERR(EINVAL);
|
return DRM_ERR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
masks = dev_priv->irq_masks;
|
||||||
cur_irq += real_irq;
|
cur_irq += real_irq;
|
||||||
|
|
||||||
if (masks[real_irq][2] && !force_sequence) {
|
if (masks[real_irq][2] && !force_sequence) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче