change pointer check order

This commit is contained in:
Ralph Metzler 2017-07-11 20:20:39 +02:00
parent 452771913e
commit 8c46d9a86a
1 changed files with 2 additions and 2 deletions

View File

@ -498,9 +498,9 @@ static int ddb_redirect(u32 i, u32 p)
struct ddb *pdev = ddbs[(p >> 4) & 0x3f];
struct ddb_port *port;
if (!idev->has_dma || !pdev->has_dma)
if (!pdev || !idev)
return -EINVAL;
if (!idev || !pdev)
if (!pdev->has_dma || !idev->has_dma)
return -EINVAL;
port = &pdev->port[p & 0x0f];