diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2019-07-30 16:08:13 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-31 18:56:11 -0400 |
commit | 271da132e29b5341c31eca6ba6a72ea1302ebac8 (patch) | |
tree | 377ec16d41bf9f3e17297d6b9d0f6718d44a12bc /net | |
parent | e29903c49990376e5e928b20f658cdf7c29bf1eb (diff) |
net: phy: phy_led_triggers: Fix a possible null-pointer dereference in phy_led_trigger_change_speed()
In phy_led_trigger_change_speed(), there is an if statement on line 48
to check whether phy->last_triggered is NULL:
if (!phy->last_triggered)
When phy->last_triggered is NULL, it is used on line 52:
led_trigger_event(&phy->last_triggered->trigger, LED_OFF);
Thus, a possible null-pointer dereference may occur.
To fix this bug, led_trigger_event(&phy->last_triggered->trigger,
LED_OFF) is called when phy->last_triggered is not NULL.
This bug is found by a static analysis tool STCheck written by
the OSLAB group in Tsinghua University.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions