Merge "msm: ipa: Fix memory leak in ipa driver"
This commit is contained in:
commit
0eb82372dc
2 changed files with 8 additions and 0 deletions
|
@ -562,6 +562,8 @@ ssize_t ipa_read(struct file *filp, char __user *buf, size_t count,
|
|||
mutex_unlock(&ipa_ctx->msg_lock);
|
||||
if (copy_to_user(buf, &msg->meta,
|
||||
sizeof(struct ipa_msg_meta))) {
|
||||
kfree(msg);
|
||||
msg = NULL;
|
||||
ret = -EFAULT;
|
||||
break;
|
||||
}
|
||||
|
@ -570,6 +572,8 @@ ssize_t ipa_read(struct file *filp, char __user *buf, size_t count,
|
|||
if (msg->buff) {
|
||||
if (copy_to_user(buf, msg->buff,
|
||||
msg->meta.msg_len)) {
|
||||
kfree(msg);
|
||||
msg = NULL;
|
||||
ret = -EFAULT;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -572,6 +572,8 @@ ssize_t ipa3_read(struct file *filp, char __user *buf, size_t count,
|
|||
if (copy_to_user(buf, &msg->meta,
|
||||
sizeof(struct ipa_msg_meta))) {
|
||||
ret = -EFAULT;
|
||||
kfree(msg);
|
||||
msg = NULL;
|
||||
break;
|
||||
}
|
||||
buf += sizeof(struct ipa_msg_meta);
|
||||
|
@ -580,6 +582,8 @@ ssize_t ipa3_read(struct file *filp, char __user *buf, size_t count,
|
|||
if (copy_to_user(buf, msg->buff,
|
||||
msg->meta.msg_len)) {
|
||||
ret = -EFAULT;
|
||||
kfree(msg);
|
||||
msg = NULL;
|
||||
break;
|
||||
}
|
||||
buf += msg->meta.msg_len;
|
||||
|
|
Loading…
Add table
Reference in a new issue