Commit 10db8d21 authored by Kleber Sacilotto de Souza's avatar Kleber Sacilotto de Souza Committed by Benjamin Herrenschmidt

powerpc/eeh: Check handle_eeh_events() return value

Function eeh_event_handler() dereferences the pointer returned by
handle_eeh_events() without checking, causing a crash if NULL was
returned, which is expected in some situations.

This patch fixes this bug by checking for the value returned by
handle_eeh_events() before dereferencing it.
Signed-off-by: default avatarKleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
CC: stable@vger.kernel.org [v3.4+]
parent 26b0d141
...@@ -85,8 +85,10 @@ static int eeh_event_handler(void * dummy) ...@@ -85,8 +85,10 @@ static int eeh_event_handler(void * dummy)
set_current_state(TASK_INTERRUPTIBLE); /* Don't add to load average */ set_current_state(TASK_INTERRUPTIBLE); /* Don't add to load average */
edev = handle_eeh_events(event); edev = handle_eeh_events(event);
if (edev) {
eeh_clear_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING); eeh_clear_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING);
pci_dev_put(edev->pdev); pci_dev_put(edev->pdev);
}
kfree(event); kfree(event);
mutex_unlock(&eeh_event_mutex); mutex_unlock(&eeh_event_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment