mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
qcacmn: Check NULL pointer before use it
Check NULL pointer before use it. Change-Id: Id5b5d3ac38bffdbfee4463e93e3a586e9da1fac2 CRs-Fixed: 2177902
This commit is contained in:
parent
124b766d2e
commit
69a4679e57
1 changed files with 7 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
|
|
@ -254,10 +254,12 @@ static ssize_t qdf_seq_write(struct file *filp, const char __user *ubuf,
|
|||
fops = seq->private;
|
||||
if (fops && fops->write) {
|
||||
buf = qdf_mem_malloc(len + 1);
|
||||
buf[len] = '\0';
|
||||
rc = simple_write_to_buffer(buf, len, ppos, ubuf, len);
|
||||
fops->write(fops->priv, buf, len + 1);
|
||||
qdf_mem_free(buf);
|
||||
if (buf) {
|
||||
buf[len] = '\0';
|
||||
rc = simple_write_to_buffer(buf, len, ppos, ubuf, len);
|
||||
fops->write(fops->priv, buf, len + 1);
|
||||
qdf_mem_free(buf);
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
|
|
|||
Loading…
Reference in a new issue