Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-01 Thread Rohit Sarkar
On Tue, Oct 01, 2019 at 10:00:56PM +0300, Dan Carpenter wrote: > > No. scnprintf() returns the number of characters *not counting the > NUL terminator*. So it can be a maximum of MAX_WPA_IE_LEN - 1. > > regards, > dan carpenter TIL :) Would the better approach be to just remove the loop or bre

[PATCH v2] staging: speakup: document sysfs attributes

2019-10-01 Thread Okash Khawaja
Speakup exposes a set of sysfs attributes under /sys/accessibility/speakup/ for user-space to interact with and configure speakup's kernel modules. This patch describes those attributes. Some attributes either lack a description or contain incomplete description. They are marked wit TODO. Authored

Re: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls

2019-10-01 Thread Denis Efremov
On 01.10.2019 21:58, Dan Carpenter wrote: > On Tue, Oct 01, 2019 at 06:13:21PM +0300, Denis Efremov wrote: >> Just found an official documentation to this issue: >> https://gcc.gnu.org/gcc-4.9/porting_to.html >> "Null pointer checks may be optimized away more aggressively >> ... >> The pointers pas

Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-01 Thread Dan Carpenter
On Tue, Oct 01, 2019 at 11:09:26PM +0530, Rohit Sarkar wrote: > On Tue, Oct 01, 2019 at 11:45:14AM +0300, Dan Carpenter wrote: > > > diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > > b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > > index b08b9a191a34..ff5edcaba64d 100644 > > >

Re: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls

2019-10-01 Thread Dan Carpenter
On Tue, Oct 01, 2019 at 06:13:21PM +0300, Denis Efremov wrote: > Just found an official documentation to this issue: > https://gcc.gnu.org/gcc-4.9/porting_to.html > "Null pointer checks may be optimized away more aggressively > ... > The pointers passed to memmove (and similar functions in ) must b

Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-01 Thread Rohit Sarkar
On Tue, Oct 01, 2019 at 11:45:14AM +0300, Dan Carpenter wrote: > > diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > index b08b9a191a34..ff5edcaba64d 100644 > > --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > +++ b/drivers/st

RE: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls

2019-10-01 Thread David Laight
From: Denis Efremov > Sent: 01 October 2019 16:13 ... > Just found an official documentation to this issue: > https://gcc.gnu.org/gcc-4.9/porting_to.html > "Null pointer checks may be optimized away more aggressively > ... > The pointers passed to memmove (and similar functions in ) must be > non-

Re: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls

2019-10-01 Thread Denis Efremov
On 10/1/19 5:36 PM, David Laight wrote: >> From: Dan Carpenter >> Sent: 01 October 2019 14:57 >> Subject: Re: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls > ... >> That's true for glibc memcpy() but not for the kernel memcpy(). In the >> kernel there are lots of places which do a zero size me

RE: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls

2019-10-01 Thread David Laight
> From: Dan Carpenter > Sent: 01 October 2019 14:57 > Subject: Re: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls ... > That's true for glibc memcpy() but not for the kernel memcpy(). In the > kernel there are lots of places which do a zero size memcpy(). And probably from NULL (or even garbag

Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-01 Thread Dan Carpenter
On Wed, Sep 11, 2019 at 12:25:03AM +0530, Rohit Sarkar wrote: > Resending as I made a typo in Larry's email id. > I commented on the earlier email, but this email doesn't apply with `git am` so it would be difficult for Larry to review it. regards, dan carpenter

Re: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls

2019-10-01 Thread Dan Carpenter
On Mon, Sep 30, 2019 at 05:25:43PM +0300, Denis Efremov wrote: > On 9/30/19 4:18 PM, David Laight wrote: > > From: Denis Efremov > >> Sent: 30 September 2019 12:02 > >> memcpy() in phy_ConfigBBWithParaFile() and PHY_ConfigRFWithParaFile() is > >> called with "src == NULL && len == 0". This is an un

[driver-core:debugfs_remove_return_value 3/9] arch/powerpc/platforms/pseries/dtl.c:356:19: error: void value not ignored as it ought to be

2019-10-01 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git debugfs_remove_return_value head: 2a00e100fa7b9ee326af19617a84b138c8bd086a commit: 7f3671a8c54b423d8227d7a58e6dc8c5734cda19 [3/9] debugfs: remove return value of debugfs_create_u32() config: powerpc-ppc64_defconfig (

Re: [PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc

2019-10-01 Thread Dan Carpenter
On Sun, Sep 29, 2019 at 10:09:45PM -0500, Navid Emamdoost wrote: > In fbtft_framebuffer_alloc the error handling path should take care of > releasing frame buffer after it is allocated via framebuffer_alloc, too. > Therefore, in two failure cases the goto destination is changed to > address this is

Re: [PATCH 2/3] Staging: exfat: exfat_super.c: fixed multiple coding style issues with camelcase and parentheses

2019-10-01 Thread Dan Carpenter
On Sun, Sep 29, 2019 at 09:52:29AM -0500, Jesse Barton wrote: > Changed Function Names: > ffsGetVolInfo -> ffs_get_vol_info > ffsLookupFile -> ffs_lookup_file > ffsCreateFile -> ffs_create_file > ffsReadFile -> ffs_read_file > ffsWriteFile -> ffs_write_file > ffsTruncateFile -> ffs_truncate_file >

Re: [PATCH 2/3] Staging: exfat: exfat_super.c: fixed multiple coding style issues with camelcase and parentheses

2019-10-01 Thread Dan Carpenter
On Sat, Sep 28, 2019 at 07:22:33PM -0500, Jesse Barton wrote: > Fixed coding style issues with camelcase on functions and various parentheses > that were not needed > Do this as two separate patches. regards, dan carpenter ___ devel mailing list de..

Re: [PATCH 3/3] Staging: exfat: exfat_super.c Fixed coding style issues.

2019-10-01 Thread Dan Carpenter
On Sat, Sep 28, 2019 at 07:21:19PM -0500, Jesse Barton wrote: > Fixed Coding Style issues Which ones? > > Signed-off-by: Jesse Barton > --- > drivers/staging/exfat/exfat_super.c | 29 + > 1 file changed, 9 insertions(+), 20 deletions(-) > > diff --git a/drivers/sta

Re: [PATCH] staging: rtl8188eu: fix null dereference when kzalloc fails

2019-10-01 Thread Dan Carpenter
On Fri, Sep 27, 2019 at 02:44:15PM -0700, Connor Kuehl wrote: > If kzalloc() returns NULL, the error path doesn't stop the flow of > control from entering rtw_hal_read_chip_version() which dereferences the > null pointer. Fix this by adding a 'goto' to the error path to more > gracefully handle the

Re: [PATCH] staging: rtl8723bs: Variable rf_type in function rtw_cfg80211_init_wiphy() could be uninitialized

2019-10-01 Thread Dan Carpenter
On Fri, Sep 27, 2019 at 05:06:51PM -0700, Yizhuo wrote: > In function rtw_cfg80211_init_wiphy(), local variable "rf_type" could > be uninitialized if function rtw_hal_get_hwreg() fails to initialize > it. However, this value is used in function rtw_cfg80211_init_ht_capab() > and used to decide the

Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-01 Thread Dan Carpenter
On Wed, Sep 11, 2019 at 12:19:31AM +0530, Rohit Sarkar wrote: > When the number of bytes to be printed exceeds the limit snprintf > returns the number of bytes that would have been printed (if there was > no truncation). This might cause issues, hence use scnprintf which ^