[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110617221114.GA2441@electric-eye.fr.zoreil.com>
Date: Sat, 18 Jun 2011 00:11:14 +0200
From: Francois Romieu <romieu@...zoreil.com>
To: Ben Hutchings <bhutchings@...arflare.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
Realtek linux nic maintainers <nic_swsd@...ltek.com>,
Hayes Wang <hayeswang@...ltek.com>,
Ben Hutchings <ben@...adent.org.uk>
Subject: Re: [PATCH net-next 2/4] r8169: explicit firmware format check.
Ben Hutchings <bhutchings@...arflare.com> :
[...]
> > @@ -1230,7 +1239,7 @@ static void rtl8169_get_drvinfo(struct net_device *dev,
> > strcpy(info->version, RTL8169_VERSION);
> > strcpy(info->bus_info, pci_name(tp->pci_dev));
> > strncpy(info->fw_version, IS_ERR_OR_NULL(rtl_fw) ? "N/A" :
> > - rtl_lookup_firmware_name(tp), sizeof(info->fw_version) - 1);
> > + rtl_fw->version, RTL_VER_SIZE);
>
> You appear to ensure that rtl_fw->version is properly terminated, so I
> would suggest:
>
> BUILD_BUG_ON(sizeof(info->fw_version) < sizeof(rtl_fw->version));
> strcpy(info->fw_version, IS_ERR_OR_NULL(rtl_fw) ? "N/A" : rtl_fw->version);
Ok.
[...]
> > + if (!(fw->size % FW_OPCODE_SIZE)) {
> > + snprintf(rtl_fw->version, RTL_VER_SIZE, "%s",
> > + rtl_lookup_firmware_name(tp));
>
> strlcpy()
Ok.
[...]
> This function is doing rather more than what its name suggests. And it
> always returns true, so it doesn't actually do what its name suggests at
> all.
No idea for a short better name. Will fix the return part.
--
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists