[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DB3PR0402MB3849646B999712EE93DC9207EC4B0@DB3PR0402MB3849.eurprd04.prod.outlook.com>
Date: Thu, 12 Oct 2017 09:11:02 +0000
From: Madalin-cristian Bucur <madalin.bucur@....com>
To: David Miller <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"andrew@...n.ch" <andrew@...n.ch>,
"vivien.didelot@...oirfairelinux.com"
<vivien.didelot@...oirfairelinux.com>,
"junote@...look.com" <junote@...look.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 3/4] dpaa_eth: change device used
> -----Original Message-----
> From: David Miller [mailto:davem@...emloft.net]
> Sent: Thursday, October 12, 2017 12:02 AM
> To: Madalin-cristian Bucur <madalin.bucur@....com>
> Subject: Re: [PATCH 3/4] dpaa_eth: change device used
>
> From: Madalin Bucur <madalin.bucur@....com>
> Date: Tue, 10 Oct 2017 17:10:17 +0300
>
> > @@ -2696,7 +2681,13 @@ static int dpaa_eth_probe(struct platform_device
> *pdev)
> > int err = 0, i, channel;
> > struct device *dev;
> >
> > - dev = &pdev->dev;
> > + /* device used for DMA mapping */
> > + dev = pdev->dev.parent;
> > + err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(40));
> > + if (err) {
> > + dev_err(dev, "dma_coerce_mask_and_coherent() failed\n");
> > + goto dev_mask_failed;
> > + }
> >
> > /* Allocate this early, so we can store relevant information in
> > * the private area
>
> Since you are moving this code up before the netdev allocation, you must
> adjust the failure path goto label used.
>
> Your change as-is will cause an OOPS because we'll pass a NULL pointer
> to free_netdev().
Thank you, besides this new issue I was introducing I see there other problems,
I'll include a cleanup of these error paths in v2.
Madalin
Powered by blists - more mailing lists