]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - drivers/net/ethernet/ti/davinci_cpdma.c
net: ethernet: ti: cpdma: correct error handling for chan create
[mirror_ubuntu-eoan-kernel.git] / drivers / net / ethernet / ti / davinci_cpdma.c
index e4d6edf387b34571242b720306602528ddf94fe3..6f9173ff941495564a1567d5fe1c3b2962188857 100644 (file)
@@ -893,7 +893,7 @@ struct cpdma_chan *cpdma_chan_create(struct cpdma_ctlr *ctlr, int chan_num,
        chan_num = rx_type ? rx_chan_num(chan_num) : tx_chan_num(chan_num);
 
        if (__chan_linear(chan_num) >= ctlr->num_chan)
-               return NULL;
+               return ERR_PTR(-EINVAL);
 
        chan = devm_kzalloc(ctlr->dev, sizeof(*chan), GFP_KERNEL);
        if (!chan)