aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/ozwpan/ozcdev.c
AgeCommit message (Collapse)Author
2013-10-30staging: ozwpan: prevent overflow in oz_cdev_write()Dan Carpenter
We need to check "count" so we don't overflow the ei->data buffer. Reported-by: Nico Golde <nico@ngolde.de> Reported-by: Fabian Yamaguchi <fabs@goesec.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-08-28staging: ozwpan: Return error, if PD is not connected.Rupesh Gujare
Return error if we receive write(), while PD is not connected. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-28staging: ozwpan: Change error number.Rupesh Gujare
Incorrect error number was returned here (EPERM), ENXIO is more appropriate. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: ozwpan: Fix Documentation style.Rupesh Gujare
This patch fixes Kernel Documentation style. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-14staging: ozwpan: Add a blank line between functions & declarations.Rupesh Gujare
This patch adds a blank line between global declarations & functions for readability. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-14staging: ozwpan: Add a blank line between declaraction and code.Rupesh Gujare
This patch adds blank line between declaration & code for readability. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25staging: ozwpan: Fix coding style.Rupesh Gujare
This patch fixes coding style issues reported by Dan here:- http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2012-June/027767.html Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: ozwpan: Remove old debug macro.Joe Perches
Remove old oz_trace & oz_trace2 macro & related header files. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: ozwpan: Replace oz_trace with oz_dbgJoe Perches
Introduce new debug macros: oz_dbg, oz_cdev_dbg, oz_pd_dbg and then replace old oz_trace & oz_trace2 with new macro. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: ozwpan: Remove extra debug logs.Joe Perches
Remove unnecessary debug logs. Most of these logs print function name at the start of function, which are not really required. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17staging: ozwpan: remove event tracing code.Rupesh Gujare
Removes event tracing code as it can be replaced by in-kernel tracing infrastructure. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13staging: ozwpan: fix error return code in oz_cdev_register()Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-22staging/ozwpan: info leak in oz_cdev_ioctl()Dan Carpenter
If we're not maxed out then oz_get_pd_list() leaves part of the "list" struct uninitialized. We should clear this so that no stack information is leaked to userspace. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/ozwpan: Mark read only parameters and structs as constPeter Huewe
This patch marks function parameters that are used read only as well as readonly structs (and corresponding pointers) as const. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/ozwpan: Remove empty and unused function oz_cdev_heartbeatPeter Huewe
oz_cdev_heartbeat is empty and unused -> safe to remove. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/ozwpan: Mark local functions as static (fix sparse warnings)Peter Huewe
sparse complains about the following functions ozhcd.c:330:20: warning: symbol 'oz_uncancel_urb' was not declared. Should it be static? ozhcd.c:420:6: warning: symbol 'oz_complete_buffered_urb' was not declared. Should it be static? ozmain.c:25:6: warning: symbol 'g_net_dev' was not declared. Should it be static? ozevent.c:95:5: warning: symbol 'oz_events_open' was not declared. Should it be static? ozevent.c:110:5: warning: symbol 'oz_events_release' was not declared. Should it be static? ozevent.c:121:9: warning: symbol 'oz_events_read' was not declared. Should it be static? ozevent.c:160:30: warning: symbol 'oz_events_fops' was not declared. Should it be static? ozcdev.c:47:14: warning: symbol 'g_oz_class' was not declared. Should it be static? ozcdev.c:74:5: warning: symbol 'oz_cdev_open' was not declared. Should it be static? ozcdev.c:86:5: warning: symbol 'oz_cdev_release' was not declared. Should it be static? ozcdev.c:94:9: warning: symbol 'oz_cdev_read' was not declared. Should it be static? ozcdev.c:146:9: warning: symbol 'oz_cdev_write' was not declared. Should it be static? ozcdev.c:236:6: warning: symbol 'oz_cdev_ioctl' was not declared. Should it be static? ozcdev.c:300:14: warning: symbol 'oz_cdev_poll' was not declared. Should it be static? ozcdev.c:321:30: warning: symbol 'oz_fops' was not declared. Should it be static? ozproto.c:958:6: warning: context imbalance in 'oz_polling_lock_bh' - wrong count at exit ozproto.c:964:6: warning: context imbalance in 'oz_polling_unlock_bh' - unexpected unlock ozusbsvc1.c:308:6: warning: symbol 'oz_usb_handle_ep_data' was not declared. Should it be static? ozpd.c:410:6: warning: symbol 'oz_set_more_bit' was not declared. Should it be static? ozpd.c:418:6: warning: symbol 'oz_set_last_pkt_nb' was not declared. Should it be static? -> add static keyword to silence the warning and make sparse happy. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/ozwpan: Add missing header includesPeter Huewe
ozcdev.c and ozhcd.c should include their own header file, so sparse knows which functions are declared and which not. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/ozwpan: Fix NULL vs zero in ozcdev.c (sparse warning)Peter Huewe
This patch fixes the warning "Using plain integer as NULL pointer", generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-19staging: ozwpan: compare pointer to NULL rather than 0Fengguang Wu
Generated by: scripts/coccinelle/null/badzero.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: ozwpan: fix memcmp() test in oz_set_active_pd()Tomas Winkler
"addr" is a pointer so it's either 4 or 8 bytes, but actually we want to compare 6 bytes (ETH_ALEN). As network stack already provides helper function is_zero_ether_addr() we use that instead of memcmp Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26staging: ozwpan: Unregister with sysfs while unloading.Rupesh Gujare
Destroy device node & unregister device class from sysfs while unloading driver Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20staging: ozwpan: udev supportRupesh Gujare
Register ozmo_wpan class with sysfs & support for udev to create device node. Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging: ozwpan: Replace existing event logging mechanismRupesh Gujare
This patch replaces existing event logging mechanism from ioctl to debugfs. This patch replaces previous patch submitted by Chris Kelly. Previous patch can be found at :- http://article.gmane.org/gmane.linux.usb.general/60026/ Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-02staging: ozwpan: remove debug allocatorGreg Kroah-Hartman
The kernel already has a debug allocator, no need to have one unique to a single driver. So delete it, replace with kfree, kmalloc, and, in a few places that need it, kzalloc(). Cc: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24staging: ozwpan: Added character device supportChris Kelly
The character device provides a management interface to the driver and also provides an additional service to the protocol for side band communication with the device. Signed-off-by: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>