mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
allocate_flower_entry: should check for null deref
allocate_flower_entry does not check for allocation success, but tries to deref the result. I only moved the spin_lock under null check, because the caller is checking allocation's status at line 652. Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4803d01001
commit
bb1320834b
1 changed files with 2 additions and 1 deletions
|
|
@ -67,7 +67,8 @@ static struct ch_tc_pedit_fields pedits[] = {
|
|||
static struct ch_tc_flower_entry *allocate_flower_entry(void)
|
||||
{
|
||||
struct ch_tc_flower_entry *new = kzalloc(sizeof(*new), GFP_KERNEL);
|
||||
spin_lock_init(&new->lock);
|
||||
if (new)
|
||||
spin_lock_init(&new->lock);
|
||||
return new;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue