mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
video: rockchip: fb: fix inconsistent returns 'mutex:&dev_drv->front_lock'
Change-Id: If937a6cbc6d89ff0b4dbd2f540a87da1af3c4123 Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
This commit is contained in:
committed by
Huang, Tao
parent
766e5dbd77
commit
f658b81102
@@ -431,17 +431,14 @@ static ssize_t set_dump_buffer(struct device *dev,
|
||||
return PTR_ERR(dentry);
|
||||
}
|
||||
|
||||
mutex_lock(&dev_drv->front_lock);
|
||||
if (!num_frames) {
|
||||
mutex_lock(&dev_drv->front_lock);
|
||||
|
||||
if (!dev_drv->front_regs) {
|
||||
u16 xact, yact;
|
||||
int data_format;
|
||||
u32 dsp_addr;
|
||||
int ymirror;
|
||||
|
||||
mutex_unlock(&dev_drv->front_lock);
|
||||
|
||||
if (dev_drv->ops->get_dspbuf_info)
|
||||
dev_drv->ops->get_dspbuf_info(dev_drv, &xact,
|
||||
&yact, &data_format, &dsp_addr,
|
||||
@@ -452,8 +449,10 @@ static ssize_t set_dump_buffer(struct device *dev,
|
||||
goto out;
|
||||
}
|
||||
front_regs = kmalloc(sizeof(*front_regs), GFP_KERNEL);
|
||||
if (!front_regs)
|
||||
if (!front_regs) {
|
||||
mutex_unlock(&dev_drv->front_lock);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memcpy(front_regs, dev_drv->front_regs, sizeof(*front_regs));
|
||||
|
||||
for (i = 0; i < front_regs->win_num; i++) {
|
||||
@@ -491,8 +490,6 @@ static ssize_t set_dump_buffer(struct device *dev,
|
||||
}
|
||||
|
||||
kfree(front_regs);
|
||||
|
||||
mutex_unlock(&dev_drv->front_lock);
|
||||
} else {
|
||||
trace->num_frames = num_frames;
|
||||
trace->count_frame = 0;
|
||||
@@ -502,7 +499,7 @@ static ssize_t set_dump_buffer(struct device *dev,
|
||||
trace->mask_area = mask_area;
|
||||
}
|
||||
out:
|
||||
|
||||
mutex_unlock(&dev_drv->front_lock);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user