RE: [patch 4/4] s390/net: fix format string mismatches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: frank.blaschka@xxxxxxxxxx
> From: Ursula Braun <ursula.braun@xxxxxxxxxx>
> 
> cppcheck blamed some issues in drivers/s390/net/...
> They are fixed here.
...
> diff --git a/drivers/s390/net/ctcm_sysfs.c b/drivers/s390/net/ctcm_sysfs.c
> index 985b5dc..883f713 100644
> --- a/drivers/s390/net/ctcm_sysfs.c
> +++ b/drivers/s390/net/ctcm_sysfs.c
> @@ -34,8 +34,9 @@ static ssize_t ctcm_buffer_write(struct device *dev,
>  		struct device_attribute *attr, const char *buf, size_t count)
>  {
>  	struct net_device *ndev;
> -	int bs1;
> +	unsigned int bs1;
>  	struct ctcm_priv *priv = dev_get_drvdata(dev);
> +	int rc;
> 
>  	ndev = priv->channel[CTCM_READ]->netdev;
>  	if (!(priv && priv->channel[CTCM_READ] && ndev)) {
> @@ -43,7 +44,9 @@ static ssize_t ctcm_buffer_write(struct device *dev,
>  		return -ENODEV;
>  	}
> 
> -	sscanf(buf, "%u", &bs1);
> +	rc =  sscanf(buf, "%u", &bs1);

There is a spare ' ' here.
I'd have thought that there is a strtoul() function that gives
much clearer error detection than sscanf().

> +	if (rc != 1)
> +					goto einval;

and something odd with the indentation here.
and some tab/space fubar later on...

	David

��.n��������+%������w��{.n�����{��������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux