Author: Yann Droneaud <ydroneaud@opteya.com> In case of error while accessing to userspace memory, function nes_create_qp() returns NULL instead of an error code wrapped through ERR_PTR(). But NULL is not expected by ib_uverbs_create_qp(), as it check for error with IS_ERR(). As page 0 is likely not mapped, it is going to trigger an Oops when the …
Category: Linux
Mar 11 2014
IB/mthca: Return an error on ib_copy_to_udata() failure
Author: Yann Droneaud <ydroneaud@opteya.com> In case of error when writing to userspace, the function mthca_create_cq() does not set an error code before following its error path. This patch sets the error code to -EFAULT when ib_copy_to_udata() fails. This was caught when using spatch (aka. coccinelle) to rewrite call to ib_copy_{from,to}_udata(). Link: https://www.gitorious.org/opteya/coccib/source/75ebf2c1033c64c1d81df13e4ae44ee99c989eba:ib_copy_udata.cocci Link: http://marc.info/?i=cover.1394485254.git.ydroneaud@opteya.com Cc: …
Mar 11 2014
IB/ehca: Returns an error on ib_copy_to_udata() failure
Author: Yann Droneaud <ydroneaud@opteya.com> In case of error when writing to userspace, function ehca_create_cq() does not set an error code before following its error path. This patch sets the error code to -EFAULT when ib_copy_to_udata() fails. This was caught when using spatch (aka. coccinelle) to rewrite call to ib_copy_{from,to}_udata(). Link: https://www.gitorious.org/opteya/coccib/source/75ebf2c1033c64c1d81df13e4ae44ee99c989eba:ib_copy_udata.cocci Link: http://marc.info/?i=cover.1394485254.git.ydroneaud@opteya.com Cc: Signed-off-by: …
Mar 10 2014
staging: rtl8192u: Removed assignments from if statements.
Author: Chi Pham <fempsci@gmail.com> Removes assignments from if statements and simplifies unnecessary 0/NULL-checking. The following coccinelle script found the match: @@ expression E0, E1, E2; statement S0; @@ – if (E0 == (E1 = E2)) + E1 = E2; + if (E1 == E0) S0 Signed-off-by: Chi Pham Acked-by: Paul E. McKenney Signed-off-by: Peter P …
Mar 10 2014
usb: gadget: composite: switch over to ERR_CAST()
Author: Felipe Balbi <balbi@ti.com> This patch fixes the following Coccinelle warning: drivers/usb/gadget/composite.c:1142:9-16: WARNING: \ ERR_CAST can be used with uc Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman — drivers/usb/gadget/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff –git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index d742bed..fab9064 100644 — a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1139,7 +1139,7 @@ struct …
Mar 10 2014
usb: gadget: inode: switch over to memdup_user()
Author: Felipe Balbi <balbi@ti.com> This patch fixes the following Coccinelle warning: drivers/usb/gadget/inode.c:442:8-15: WARNING \ opportunity for memdup_user Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman — drivers/usb/gadget/inode.c | 9 +++—— 1 file changed, 3 insertions(+), 6 deletions(-) diff –git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index b94c049..b5be6f03 100644 — a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c @@ -439,11 +439,9 @@ ep_write (struct file *fd, …
Mar 10 2014
usb: gadget: f_subset: switch over to PTR_RET
Author: Felipe Balbi <balbi@ti.com> this patch fixes the following Coccinelle warning: drivers/usb/gadget/f_subset.c:279:8-14: WARNING: \ PTR_RET can be used Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman — drivers/usb/gadget/f_subset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff –git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c index f1a5919..df4a0dcb 100644 — a/drivers/usb/gadget/f_subset.c +++ b/drivers/usb/gadget/f_subset.c @@ -276,7 +276,7 @@ static int geth_set_alt(struct …
Mar 10 2014
usb: gadget: lpc32xx_udc: fix wrong clk_put() sequence
Author: Felipe Balbi <balbi@ti.com> This patch fixes the following Coccinelle error: drivers/usb/gadget/lpc32xx_udc.c:3313:1-7: ERROR: \ missing clk_put; clk_get on line 3139 and \ execution via conditional on line 3146 Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman — drivers/usb/gadget/lpc32xx_udc.c | 4 ++– 1 file changed, 2 insertions(+), 2 deletions(-) diff –git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c index 049ebab..a139894 100644 — …
Mar 09 2014
staging:rtl8188eu: Removed assignments in if statements.
Author: Chi Pham <fempsci@gmail.com> Fixed some indentation to silence (some) checkpatch errors. The following coccinelle script found the match: @@ expression E0, E1, E2; statement S0, S1; @@ – if ((E1 = E2) != E) + E1 = E2; + if (E1 != E) S1 else S2 Signed-off-by: Chi Pham Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/core/rtw_cmd.c …
Mar 09 2014
staging:media: Removed assignments from if statements.
Author: Chi Pham <fempsci@gmail.com> The following coccinelle script found the match: @simple@ expression E1, E2; statement S1, S2; @@ + E1 = E2; if ( – (E1 = E2) + E1 ) S1 else S2 @left@ expression E0, E1, E2; statement S0, S1; @@ – if ((E1 = E2) < E0) + E1 = E2; …