Skip to content

Commit

Permalink
xrp-kernel: fix crash in xrp_deinit
Browse files Browse the repository at this point in the history
platform drvdata may be NULL at the time xrp_deinit is called. Don't
crash in that case.

Signed-off-by: Max Filippov <[email protected]>
  • Loading branch information
jcmvbkbc committed Jul 15, 2021
1 parent 5ad8b71 commit c1be3ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xrp-kernel/xvp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2378,6 +2378,8 @@ int xrp_deinit(struct platform_device *pdev)
{
struct xvp *xvp = platform_get_drvdata(pdev);

if (!xvp)
return 0;
pm_runtime_disable(xvp->dev);
if (!pm_runtime_status_suspended(xvp->dev))
xrp_runtime_suspend(xvp->dev);
Expand Down

0 comments on commit c1be3ef

Please sign in to comment.