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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 19 Sep 2013 11:26:27 -0500
From:	Alan Tull <atull@...era.com>
To:	Michal Simek <monstr@...str.eu>
CC:	Joe Perches <joe@...ches.com>,
	Michal Simek <michal.simek@...inx.com>,
	<linux-kernel@...r.kernel.org>, Pavel Machek <pavel@....cz>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Dinh Nguyen <dinguyen@...era.com>,
	Philip Balister <philip@...ister.org>,
	Alessandro Rubini <rubini@...dd.com>,
	Mauro Carvalho Chehab <m.chehab@...sung.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Cesar Eduardo Barros <cesarb@...arb.net>,
	"David S. Miller" <davem@...emloft.net>,
	Stephen Warren <swarren@...dia.com>,
	Arnd Bergmann <arnd@...db.de>,
	David Brown <davidb@...eaurora.org>,
	Dom Cobley <popcornmix@...il.com>
Subject: Re: [RFC PATCH] fpga: Introduce new fpga subsystem


> >> +/**
> >> + * fpga_mgr_attr_read - Read data from fpga
> >> + * @dev: Pointer to the device structure
> >> + * @attr: Pointer to the device attribute structure
> >> + * @buf: Pointer to the buffer location
> >> + *
> >> + * Function reads fpga bitstream and copy them to output buffer
> >> + *
> >> + * Returns the number of bytes copied to @buf, a negative error number otherwise
> >> + */
> >> +static ssize_t fpga_mgr_attr_read(struct device *dev,
> >> +				   struct device_attribute *attr, char *buf)
> >> +{
> >> +	struct fpga_manager *mgr = dev_get_drvdata(dev);
> >> +	ssize_t count;
> >> +	int ret;
> >> +
> >> +	if (mgr && mgr->fpga_read)
> >> +		ret = mgr->fpga_read(mgr, buf, &count);
> >> +
> >> +	return ret == 0 ? count : -EPERM;
> > 
> > EPERM isn't the only error return from fpga_read.
> 
> Yeah I know. Will revisit all return codes.

Build warning:
/home/atull/repos/linux-socfpga/drivers/fpga/fpga-mgr.c:145:26: warning:
‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]


> 
> > 
> > 
> >> +/**
> >> + * fpga_mgr_attr_write - Write data to fpga
> >> + * @dev: Pointer to the device structure
> >> + * @attr: Pointer to the device attribute structure
> >> + * @buf: Pointer to the buffer location with bistream firmware filename
> >> + * @count: Number of characters in @buf
> >> + *
> >> + * @buf contains firmware filename which is loading through firmware
> >> + * interface and passed to the fpga driver.
> >> + *
> >> + * Returns string lenght added to @buf, a negative error number otherwise
> >> + */
> >> +static ssize_t fpga_mgr_attr_write(struct device *dev,
> >> +				   struct device_attribute *attr,
> >> +				   const char *buf, size_t count)
> >> +{
> >> +	struct fpga_manager *mgr = dev_get_drvdata(dev);
> >> +	int ret;
> >> +
> >> +	if (mgr && mgr->fpga_write)
> >> +		ret = mgr->fpga_write(mgr, buf);
> >> +
> >> +	return ret == 0 ? strlen(buf) : -EPERM;
> >> +}
> > 
> > Same -EPERM issue as read
> 
> yap

Build warning:
/home/atull/repos/linux-socfpga/drivers/fpga/fpga-mgr.c:236:2: warning:
‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Best Regards,
Alan



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ