[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170811155057.30cb4966@xeon-e3>
Date: Fri, 11 Aug 2017 15:50:57 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: <Bryan.Whitehead@...rochip.com>
Cc: <netdev@...r.kernel.org>, <davem@...emloft.net>,
<UNGLinuxDriver@...rochip.com>
Subject: Re: [PATCH net-next 1/3] Add LAN743X driver
On Fri, 11 Aug 2017 19:47:57 +0000
<Bryan.Whitehead@...rochip.com> wrote:
> +
> + netdev = alloc_etherdev(sizeof(struct lan743x_adapter));
> + if (!netdev) {
> + NETIF_ERROR(adapter, probe, adapter->netdev,
> + "alloc_etherdev returned NULL");
> + ret = -ENOMEM;
> + goto clean_up;
> + }
> +
> + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
> + SET_NETDEV_DEV(netdev, &pdev->dev);
> + pci_set_drvdata(pdev, netdev);
> + adapter = netdev_priv(netdev);
> + if (!adapter) {
> + NETIF_ERROR(adapter, probe, adapter->netdev,
> + "netdev_priv returned NULL");
> + ret = -ENOMEM;
> + goto clean_up;
> + }
> + memset(adapter, 0, sizeof(struct lan743x_adapter));
netdev_priv area is already zerod
Powered by blists - more mailing lists