From: Gur Stavi <gur.stavi@huawei.com>
To: <sumang@marvell.com>
Cc: <andrew+netdev@lunn.ch>, <cai.huoqing@linux.dev>,
<corbet@lwn.net>, <davem@davemloft.net>, <edumazet@google.com>,
<gongfan1@huawei.com>, <guoxin09@huawei.com>,
<gur.stavi@huawei.com>, <helgaas@kernel.org>, <horms@kernel.org>,
<kuba@kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <meny.yossefi@huawei.com>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>,
<shenchenyang1@hisilicon.com>, <shijing34@huawei.com>,
<wulike1@huawei.com>, <zhoushuai28@huawei.com>
Subject: RE: [EXTERNAL] [PATCH net-next v03 1/1] hinic3: module initialization and tx/rx logic
Date: Tue, 7 Jan 2025 12:23:11 +0200 [thread overview]
Message-ID: <20250107102311.3552206-1-gur.stavi@huawei.com> (raw)
In-Reply-To: <SJ0PR18MB5216BED17023369322EE4A6ADB152@SJ0PR18MB5216.namprd18.prod.outlook.com>
> >+static struct hinic3_adev *hinic3_add_one_adev(struct hinic3_hwdev
> >*hwdev,
> >+ enum hinic3_service_type svc_type)
> >+{
> >+ struct hinic3_adev *hadev;
> >+ const char *svc_name;
> >+ int ret;
> >+
> >+ hadev =3D kzalloc(sizeof(*hadev), GFP_KERNEL);
> >+ if (!hadev)
> >+ return NULL;
> >+
> >+ svc_name =3D hinic3_adev_devices[svc_type].name;
> >+ hadev->adev.name =3D svc_name;
> >+ hadev->adev.id =3D hwdev->dev_id;
> >+ hadev->adev.dev.parent =3D hwdev->dev;
> >+ hadev->adev.dev.release =3D hinic3_comm_adev_release;
> >+ hadev->svc_type =3D svc_type;
> >+ hadev->hwdev =3D hwdev;
> >+
> >+ ret =3D auxiliary_device_init(&hadev->adev);
> >+ if (ret) {
> >+ dev_err(hwdev->dev, "failed init adev %s %u\n",
> >+ svc_name, hwdev->dev_id);
> >+ kfree(hadev);
> >+ return NULL;
> >+ }
> >+
> >+ ret =3D auxiliary_device_add(&hadev->adev);
> >+ if (ret) {
> >+ dev_err(hwdev->dev, "failed to add adev %s %u\n",
> >+ svc_name, hwdev->dev_id);
> >+ auxiliary_device_uninit(&hadev->adev);
> [Suman] memleak for hadev?
No. Calling auxiliary_device_uninit after a successful
auxiliary_device_init will trigger a call to hinic3_comm_adev_release
that releases the memory.
> >+ return NULL;
> >+ }
> >+
> >+ return hadev;
> >+}
> >+
next prev parent reply other threads:[~2025-01-07 10:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-01 13:04 [PATCH net-next v03 0/1] net: hinic3: Add a driver for Huawei 3rd gen NIC Gur Stavi
2025-01-01 13:04 ` [PATCH net-next v03 1/1] hinic3: module initialization and tx/rx logic Gur Stavi
2025-01-03 8:47 ` [EXTERNAL] " Suman Ghosh
2025-01-07 10:23 ` Gur Stavi [this message]
2025-01-07 10:37 ` Gur Stavi
2025-01-07 14:03 ` Gur Stavi
2025-01-08 5:51 ` Gur Stavi
2025-01-02 16:53 ` [PATCH net-next v03 0/1] net: hinic3: Add a driver for Huawei 3rd gen NIC Jakub Kicinski
2025-01-05 7:30 ` Gur Stavi
2025-01-05 16:32 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250107102311.3552206-1-gur.stavi@huawei.com \
--to=gur.stavi@huawei.com \
--cc=andrew+netdev@lunn.ch \
--cc=cai.huoqing@linux.dev \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gongfan1@huawei.com \
--cc=guoxin09@huawei.com \
--cc=helgaas@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=meny.yossefi@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenchenyang1@hisilicon.com \
--cc=shijing34@huawei.com \
--cc=sumang@marvell.com \
--cc=wulike1@huawei.com \
--cc=zhoushuai28@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®