android_kernel_xiaomi_sm8350/lib
Martin Stoilov 1350770112 kobject: kobj->k_name verification fix
The function 'kobject_add' tries to verify the name of
a new kobject instance is properly set before continuing.
    if (!kobj->k_name)
        kobj->k_name = kobj->name;
    if (!kobj->k_name) {
        pr_debug("kobject attempted to be registered with no name!\n");
        WARN_ON(1);
        return -EINVAL;
    }
The statement:
    if (!kobj->k_name) {
        pr_debug("kobject attempted to be registered with no name!\n");
        WARN_ON(1);
        return -EINVAL;
    }
is useless the way it is right now, because it can never be true. I
think the
code was intended to be:
    if (!kobj->k_name)
        kobj->k_name = kobj->name;
    if (!*kobj->k_name) {
        pr_debug("kobject attempted to be registered with no name!\n");
        WARN_ON(1);
        return -EINVAL;
    }
because this would make sure the kobj->name buffer has something in it.
So the missing '*' is just a typo. Although, I would much prefer
expression like:
    if (*kobj->k_name == '\0') {
        pr_debug("kobject attempted to be registered with no name!\n");
        WARN_ON(1);
        return -EINVAL;
    }

because this would've made the intention clear, in this patch I just restore
the missing '*' without changing the coding style of the function.

Signed-off-by: Martin Stoilov <mstoilov@odesys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-02-16 15:19:17 -08:00
..
reed_solomon fix file specification in comments 2006-10-03 23:01:26 +02:00
zlib_deflate
zlib_inflate
.gitignore
audit.c
bitmap.c [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
bitrev.c [PATCH] add MODULE_* attributes to bit reversal library 2006-12-10 10:07:52 -08:00
bug.c [PATCH] Generic BUG implementation 2006-12-08 08:28:39 -08:00
bust_spinlocks.c [PATCH] Extract and use wake_up_klogd() 2007-02-11 10:51:34 -08:00
cmdline.c [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
cpumask.c [PATCH] highest_possible_node_id() linkage fix 2006-10-20 10:26:43 -07:00
crc16.c
crc32.c [PATCH] crc32: replace bitreverse by bitrev32 2006-12-08 08:28:39 -08:00
crc32defs.h
crc-ccitt.c
ctype.c
debug_locks.c
dec_and_lock.c
devres.c [PATCH] pci_iomap_regions() error handling fix 2007-02-16 08:13:55 -08:00
div64.c
dump_stack.c
extable.c
fault-inject.c Remove stack unwinder for now 2006-12-15 08:47:51 -08:00
find_next_bit.c
gen_crc32table.c
genalloc.c [PATCH] make genpool allocator adhere to kernel-doc standards 2006-10-02 07:57:12 -07:00
halfmd4.c
hweight.c
idr.c [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
inflate.c
int_sqrt.c
iomap_copy.c
iomap.c [PATCH] sort the devres mess out 2007-02-11 11:18:07 -08:00
ioremap.c [PATCH] uml problems with linux/io.h 2006-12-13 09:05:52 -08:00
irq_regs.c [PATCH] irq_reqs: export __irq_regs 2006-10-06 08:53:40 -07:00
Kconfig [PATCH] sort the devres mess out 2007-02-11 11:18:07 -08:00
Kconfig.debug [PATCH] Add debugging feature /proc/timer_stat 2007-02-16 08:13:59 -08:00
kernel_lock.c
klist.c
kobject_uevent.c kobject: kobject_uevent() returns manageable value 2006-12-20 10:56:44 -08:00
kobject.c kobject: kobj->k_name verification fix 2007-02-16 15:19:17 -08:00
kref.c kref refcnt and false positives 2006-12-20 10:56:43 -08:00
libcrc32c.c
list_debug.c [PATCH] More list debugging context 2006-12-07 08:39:35 -08:00
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h
locking-selftest-rsem.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h
locking-selftest-spin-softirq.h
locking-selftest-spin.h
locking-selftest-wlock-hardirq.h
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h
locking-selftest-wsem.h
locking-selftest.c [PATCH] lockdep: show more details about self-test failures 2006-12-07 08:39:43 -08:00
Makefile [PATCH] sort the devres mess out 2007-02-11 11:18:07 -08:00
parser.c
percpu_counter.c
plist.c
prio_tree.c
radix-tree.c [PATCH] hotplug CPU: clean up hotcpu_notifier() use 2006-12-07 08:39:39 -08:00
random32.c [PATCH] severing module.h->sched.h 2006-12-04 02:00:22 -05:00
rbtree.c [PATCH] rbtree: fixed reversed RB_EMPTY_NODE and rb_next/prev 2006-09-30 20:26:56 +02:00
reciprocal_div.c [PATCH] SLAB: use a multiply instead of a divide in obj_to_index() 2006-12-13 09:05:49 -08:00
rwsem-spinlock.c Lockdep: add lockdep_set_class_and_subclass() and lockdep_set_subclass() 2006-10-11 01:45:14 -04:00
rwsem.c Lockdep: add lockdep_set_class_and_subclass() and lockdep_set_subclass() 2006-10-11 01:45:14 -04:00
semaphore-sleepers.c
sha1.c [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
smp_processor_id.c
sort.c [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
spinlock_debug.c [PATCH] x86: all cpu backtrace 2006-12-07 02:14:01 +01:00
string.c [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
swiotlb.c [PATCH] swiotlb uninlinings 2007-02-12 09:48:29 -08:00
textsearch.c [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
ts_bm.c
ts_fsm.c
ts_kmp.c
vsprintf.c [PATCH] scnprintf(): fix a comment 2007-02-12 09:48:28 -08:00