lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <PH7PR21MB32635C66722888A108A51198CE5C9@PH7PR21MB3263.namprd21.prod.outlook.com> Date: Thu, 6 Oct 2022 01:48:36 +0000 From: Long Li <longli@...rosoft.com> To: Muhammad Usama Anjum <usama.anjum@...labora.com>, KY Srinivasan <kys@...rosoft.com>, Haiyang Zhang <haiyangz@...rosoft.com>, Stephen Hemminger <sthemmin@...rosoft.com>, Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>, "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Jason Gunthorpe <jgg@...pe.ca>, Ajay Sharma <sharmaajay@...rosoft.com> CC: "kernel@...labora.com" <kernel@...labora.com>, "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>, "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org> Subject: RE: [PATCH] net: mana: store return status in signed variable > Subject: [PATCH] net: mana: store return status in signed variable > > [Some people who received this message don't often get email from > usama.anjum@...labora.com. Learn why this is important at > https://aka.ms/LearnAboutSenderIdentification ] > > The mana_adev_idx_alloc() can return negative value. Save its return value > in ret which is signed variable and check if it is correct value. > > Fixes: ee928282bfa7 ("net: mana: Add support for auxiliary device") > Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com> > --- > drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c > b/drivers/net/ethernet/microsoft/mana/mana_en.c > index 7ca313c7b7b3..1c59502d34b5 100644 > --- a/drivers/net/ethernet/microsoft/mana/mana_en.c > +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c > @@ -2203,11 +2203,10 @@ static int add_adev(struct gdma_dev *gd) > return -ENOMEM; > > adev = &madev->adev; > - adev->id = mana_adev_idx_alloc(); > - if (adev->id < 0) { > - ret = adev->id; > + ret = mana_adev_idx_alloc(); > + if (ret < 0) > goto idx_fail; > - } > + adev->id = ret; > > adev->name = "rdma"; > adev->dev.parent = gd->gdma_context->dev; > -- > 2.30.2 Thank you, I'm folding this patch into the next v7 patch series. Long
Powered by blists - more mailing lists