Catégorie : Linux

staging: lustre: lnet: klnds: o2iblnd: fix null dereference on failed path in o2iblnd.c

Author: Jiayi Ye <yejiayily@gmail.com> If net is null and failed path is executed, dereference null may happen. This patch fixes it. The following Coccinelle semantic patch was used. @@ expression E, E1; identifier f; statement S1,S2,S3; @@ * if (E == NULL) { … when != if (E == NULL) S1 else S2 when != …

Lire la suite

staging: remove unneeded parentheses around the right hand side of an assignment

Author: Jiayi Ye <yejiayily@gmail.com> In assignments such as value = (FLASH_CMD_STATUS_REG_READ

staging: xgifb: Removed an unnecessary assignment statement

Author: Sarah Khan <sarahjmi07@gmail.com> Used coccinelle patch @@ expression data; identifier f; @@ -data = +return f(…); -return (data); Signed-off-by: Sarah Khan Signed-off-by: Greg Kroah-Hartman — drivers/staging/xgifb/vb_util.c | 5 +—- 1 file changed, 1 insertion(+), 4 deletions(-)   diff –git a/drivers/staging/xgifb/vb_util.c b/drivers/staging/xgifb/vb_util.c index 1b452f8..be3437ca 100644 — a/drivers/staging/xgifb/vb_util.c +++ b/drivers/staging/xgifb/vb_util.c @@ -9,11 +9,8 @@ void xgifb_reg_set(unsigned …

Lire la suite

staging: rtl8188eu: core: fix null dereference on exit path in rtw_mlme.c

Author: Jiayi Ye <yejiayily@gmail.com> If adapter is null, null dereference may occur. This patch fixes it. The following Coccinelle semantic patch was used to find the case. @@ expression E, E1; identifier f; statement S1,S2,S3; @@ * if (E == NULL) { … when != if (E == NULL) S1 else S2 when != E …

Lire la suite

Staging: vme: devices: Use kasprintf

Author: Vaishali Thakkar <vthakkar1994@gmail.com> This patch uses kasprintf which combines kmalloc and sprintf. kasprintf also takes care of the size calculation. This is done using Coccinelle. Semantic patch used is as follows: @@ expression a,flag; expression list args; statement S; @@ a = – \(kmalloc\|kzalloc\)(…,flag) + kasprintf (flag,args) – sprintf(a,args); Signed-off-by: Vaishali Thakkar Signed-off-by: Greg …

Lire la suite

iommu/msm: Deletion of unnecessary checks before clk_disable()

Author: SF Markus Elfring <elfring@users.sourceforge.net> A semantic patch approach was proposed with the subject « [PATCH with Coccinelle?] Deletion of unnecessary checks before specific function calls » on 2014-03-05. https://lkml.org/lkml/2014/3/5/344 http://article.gmane.org/gmane.comp.version-control.coccinelle/3513/ This patch pattern application was repeated with the help of the software « Coccinelle 1.0.0-rc22 » on the source files for Linux 3.17.1. An extract of the automatically …

Lire la suite

staging: media: omap24xx: Use min_t instead of min

Author: Aybuke Ozdemir <aybuke.147@gmail.com> This patch focuses on fixing the following warning generated by checkpatch.pl for the file tcm825x.c: WARNİNG: min() should probably be min_t(u32, tgt_xclk, TCM825X_XCLK_MAX) The changes were applied using the following coccinelle rule: @@ expression e1, e2; typedef u32; @@ -tgt_xclk = min(e1, (u32)e2); +tgt_xclk = min_t(u32, e1, e2); Signed-off-by: Aybuke Ozdemir …

Lire la suite

staging: lustre: lustre: obdecho: expand the GOTO macro in echo_client.c

Author: Jiayi Ye <yejiayily@gmail.com> The GOTO macro is not standard in Linux. The following Coccinelle semantic patch was used to expand the GOTO macro. @@ identifier lbl; identifier rc; constant c; @@ – GOTO(lbl,\(rc\|c\)); + goto lbl; @@ identifier lbl; expression rc; @@ – GOTO(lbl,rc); + rc; + goto lbl; Signed-off-by: Jiayi Ye Signed-off-by: Greg …

Lire la suite

staging: ft1000: ft1000-pcmcia: removed unused variable in ft1000_hw.c

Author: Jiayi Ye <yejiayily@gmail.com> Variable whose value is initialized but never used is unnecessary. The following Coccinelle semantic patch removed the unused variable. @e@ identifier i; position p; type T; @@ extern T i@p; @@ type T; identifier i; constant C; position p != e.p; @@ – T i@p; Signed-off-by: Jiayi Ye Signed-off-by: Greg Kroah-Hartman …

Lire la suite

Staging: lustre: Remove typedef ldlm_ns_hash_def_t

Author: Vaishali Thakkar <vthakkar1994@gmail.com> The linux kernel coding style guidelines suggest not using typedefs for structure types. This patch gets rid of the typedef for ldlm_ns_hash_def_t. Also, the name of the struct is changed to drop the _t, to make the name look less typedef-like. This is done using Coccinelle. Semantic patch used to detect …

Lire la suite