lkml.org 
[lkml]   [2020]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 3/3] riscv: Add cache information in AUX vector
On Sun, Aug 30, 2020 at 4:01 PM Pekka Enberg <penberg@gmail.com> wrote:
>
> On Fri, Aug 28, 2020 at 10:09 AM Zong Li <zong.li@sifive.com> wrote:
> > +uintptr_t get_cache_geometry(u32 level, enum cache_type type)
> > +{
> > + struct cacheinfo *this_leaf = get_cacheinfo(level, type);
> > + uintptr_t ret = (this_leaf->ways_of_associativity << 16 |
> > + this_leaf->coherency_line_size);
>
> You are dereferencing "this_leaf" without checking if it's NULL here.
>

oh yeah, it should check the pointer first here. Fix it in the next
version, thanks.

> > +
> > + return this_leaf ? ret : 0;
> > +}
>
> - Pekka

\
 
 \ /
  Last update: 2020-08-31 08:23    [W:0.056 / U:2.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site