Skip to content

Commit 3ea6892

Browse files
mmindMark Yao
authored andcommitted
drm/rockchip: fix error check when getting irq
platform_get_irq() can return negative error values and we already test for these. Therefore the variable holding this value should be signed to not loose possible error values. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-By: Daniel Kurtz <djkurtz@chromium.org>
1 parent 625e034 commit 3ea6892

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎drivers/gpu/drm/rockchip/rockchip_drm_vop.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
14091409
struct vop *vop;
14101410
struct resource *res;
14111411
size_t alloc_size;
1412-
int ret;
1412+
int ret, irq;
14131413

14141414
of_id = of_match_device(vop_driver_dt_match, dev);
14151415
vop_data = of_id->data;
@@ -1445,11 +1445,12 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
14451445
return ret;
14461446
}
14471447

1448-
vop->irq = platform_get_irq(pdev, 0);
1449-
if (vop->irq < 0) {
1448+
irq = platform_get_irq(pdev, 0);
1449+
if (irq < 0) {
14501450
dev_err(dev, "cannot find irq for vop\n");
1451-
return vop->irq;
1451+
return irq;
14521452
}
1453+
vop->irq = (unsigned int)irq;
14531454

14541455
spin_lock_init(&vop->reg_lock);
14551456
spin_lock_init(&vop->irq_lock);

0 commit comments

Comments
 (0)