mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
RK31/RK30:add vfree(buf); to fix memory leaks in video_state_write();
This commit is contained in:
@@ -302,8 +302,10 @@ static ssize_t video_state_write(struct file *file, const char __user *buffer,
|
||||
cookie_pot = buf;
|
||||
|
||||
if (count < 1)
|
||||
vfree(buf);
|
||||
return count;
|
||||
if (copy_from_user(cookie_pot, buffer, count)) {
|
||||
vfree(buf);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@@ -349,10 +351,12 @@ static ssize_t video_state_write(struct file *file, const char __user *buffer,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
vfree(buf);
|
||||
return -EINVAL;
|
||||
|
||||
}
|
||||
ddr.video_state = state;
|
||||
vfree(buf);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user