Skip to content

Commit

Permalink
PM / devfreq: remove redundant null pointer check before kfree
Browse files Browse the repository at this point in the history
kfree has taken the null pointer into account. hence it is safe
to remove the redundant null pointer check before kfree.

Signed-off-by: zhong jiang <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
  • Loading branch information
xiongzhongjiang authored and myungjoo committed Oct 2, 2018
1 parent 2f061fd commit 8188b15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
devfreq_remove_device(devfreq);
devfreq = NULL;
err_dev:
if (devfreq)
kfree(devfreq);
kfree(devfreq);
err_out:
return ERR_PTR(err);
}
Expand Down

0 comments on commit 8188b15

Please sign in to comment.