Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dma_request_chan result check broken #9

Open
DanielO opened this issue Jan 6, 2024 · 0 comments
Open

dma_request_chan result check broken #9

DanielO opened this issue Jan 6, 2024 · 0 comments

Comments

@DanielO
Copy link

DanielO commented Jan 6, 2024

If dma_request_chan fails (eg if you have a receive only DMA controller but used channel 0 for Rx rather than 1) then the check for NULL will pass but the driver will later cause a page fault dereferencing the result.

The check should be:

        pchannel_p->channel_p = dma_request_chan(&pdev->dev, name);
        if (IS_ERR(pchannel_p->channel_p)) {
                dev_err(pchannel_p->dma_device_p, "DMA channel request error: %d\n", PTR_ERR(pchannel_p->channel_p));
                return ERROR;
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant