All of lore.kernel.org
 help / color / mirror / Atom feed
* intel_cacheinfo: potential NULL dereference?
@ 2010-06-22 11:18 Jiri Slaby
  2010-06-22 11:20 ` Jiri Slaby
  0 siblings, 1 reply; 8+ messages in thread
From: Jiri Slaby @ 2010-06-22 11:18 UTC (permalink / raw)
  To: borislav.petkov; +Cc: H. Peter Anvin, x86, Linux kernel mailing list

Hi,

commit 9350f982 changed the code so it looks like:
static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf,
                                   const char *buf, size_t count,
                                   unsigned int slot)
{
        struct pci_dev *dev = this_leaf->l3->dev;   <<1>>
        int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
        unsigned long val = 0;

#define SUBCACHE_MASK   (3UL << 20)
#define SUBCACHE_INDEX  0xfff

        if (!this_leaf->l3 || !this_leaf->l3->can_disable)  <<2>>
                return -EINVAL;

Stanse found, that this_leaf->l3 is dereferenced at <<1>>, but checked
for being NULL at <<2>>. Is the check superfluous or the dev assignment
should go after the check?

thanks,
--
js

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-06-22 19:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 11:18 intel_cacheinfo: potential NULL dereference? Jiri Slaby
2010-06-22 11:20 ` Jiri Slaby
2010-06-22 13:08   ` Borislav Petkov
2010-06-22 14:11     ` Jiri Slaby
2010-06-22 17:09       ` H. Peter Anvin
2010-06-22 19:19         ` Borislav Petkov
2010-06-22 19:45           ` [PATCH -v2] x86, cacheinfo: Carve out L3 cache slot accessors Borislav Petkov
2010-06-22 15:15   ` intel_cacheinfo: potential NULL dereference? H. Peter Anvin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.