we have to call kobject_put() to clean up the kobject after function
kobject_init(), kobject_add(), or kobject_uevent() is called.
Signed-off-by: Cong Ding <[email protected]>
Acked-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
there is an additional "{", which causes building error.
Signed-off-by: Cong Ding <[email protected]>
Acked-by: Hans-Christian Egtvedt <[email protected]>
the variable chan is dereferenced in line 190, so it is no reason to check
null again in line 198.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Marcin Slusarz <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
There is a memory leakage in variable sg if it goes to error.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The memory allocated to ofdma might be a leakage when error occurs.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
The address of a variable is impossible to be null, so we remove the check.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Michael Krufky <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Using 'sizeof' on array given as function argument returns
size of a pointer rather than the size of array.
Cc: [email protected]
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
It is unnecessary to check i<4 after the loop; just do it before the
break.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
the variable backup_current_thread_info isn't freed before existing the
function.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
The pointer obj is dereferenced in line 146 and 149 respectively, so it is not
necessary to check null again in line 149 and 175. And I have checked that all
the callers of these two functions guarantee the parameter obj passed is not
null.
Signed-off-by: Cong Ding <[email protected]>
Acked-by: Ohad Ben-Cohen <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
The variable "str" is used as both the source and destination in
function snprintf(), which is undefined behavior based on C11. The
original description in C11 is:
"If copying takes place between objects that
overlap, the behavior is undefined."
And, the function of ceph_osdmap_state_str() is to return the osdmap
state, so it should return "doesn't exist" when all the conditions
are not satisfied. I fix it in this patch.
[[email protected]: shortened the commit message]
Signed-off-by: Cong Ding <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
When it goes to error through line 144, the memory allocated to *devname is
not freed, and the caller doesn't free it either in line 250. So we free the
memroy of *devname in function cifs_compose_mount_options() when it goes to
error.
Signed-off-by: Cong Ding <[email protected]>
CC: stable <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Steve French <[email protected]>
The use of variable packet_beacon might be uninitialized in the three files.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
The variable iommu and strbuf are not freed properly if it goes to error.
Signed-off-by: Cong Ding <[email protected]>
Reviewed-by: Richard Mortimer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
the variable chan is dereferenced in line 635, so it is no reason to check
null again in line 641.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
the pointer cfg is dereferenced in line 594, so it's no reason to check null
again in line 620.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
The pointer tty is dereferened in line 3135, so it is not necessary to check
null again in line 3140.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The pointer info is dereferened in line 1009, so it is not necessary to check
null again in line 1012.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
There is a memory leakage in variable sg if it goes to error.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
the variable inti should be freed in the branch CPUSTAT_STOPPED.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
Signed-off-by: Gleb Natapov <[email protected]>
spaces are used for indent in 3 places of tty/pty.c, we change it to tab.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
the "\n" in panic message is excess, so we remove it in tty/pty.c as what it
is used in other places.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tty: vt/Makefile: set the variables to static
In the file drivers/tty/vt/defkeymap.c generated by command
loadkeys --mktable defkeymap.map > defkeymap.c
the 6 variables: shift_map, altgr_map, ctrl_map, shift_ctrl_map, alt_map,
and ctrl_alt_map should be static because they are used only in this file.
There is no reason to remove the static by sed command.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
we should check the return value of calling function fir16_create(): a NULL
value means the memory allocation fails.
this patch also cleans up the error handling in function function oslec_create()
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
the value of err is always negative if it goes to errout, so we don't need to
check the value of err.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
the function ecryptfs_encode_for_filename() is only used in this file
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Tyler Hicks <[email protected]>
Fix this warning:
lib/rbtree_test.c: In function `check':
lib/rbtree_test.c:121: warning: `blacks' may be used uninitialized in this function
Signed-off-by: Cong Ding <[email protected]>
Cc: Michel Lespinasse <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Use WARN rather than printk followed by WARN_ON(1), for conciseness.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
The original version code causes following sparse warnings:
arch/x86/lib/inat-tables.c:1080:25: warning: duplicate const
arch/x86/lib/inat-tables.c:1095:25: warning: duplicate const
arch/x86/lib/inat-tables.c:1118:25: warning: duplicate const
for the variables inat_escape_tables, inat_group_tables, and inat_avx_tables
in the code generated by gen-insn-attr-x86.awk.
The author Masami Hiramutsu says here is to make both the value pointed by the
pointers and the pointers itself read-only, so we move the "const" to be after
the "*".
Signed-off-by: Cong Ding <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Acked-by: Masami Hiramatsu <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
We do not allow old-style function definition. Always spell foo(void) if
a function does not take any parameters.
Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>