lkml.org 
[lkml]   [2019]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v1 1/1] Add support for arm64 to carry ima measurement log in kexec_file_load
From
Date
On Wed, 2019-09-18 at 10:15 -0400, Mimi Zohar wrote:

> > + uint64_t tmp_start, tmp_end;
> > +
> > + propStart = of_find_property(of_chosen, "linux,ima-kexec-buffer",
> > + NULL);
> > + if (propStart) {
> > + tmp_start = fdt64_to_cpu(*((const fdt64_t *) propStart));
> > + ret = of_remove_property(of_chosen, propStart);
> > + if (!ret) {
> > + return ret;
> > + }
> > +
> > + propEnd = of_find_property(of_chosen,
> > + "linux,ima-kexec-buffer-end", NULL);
> > + if (!propEnd) {
> > + return -EINVAL;
> > + }
> > +
> > + tmp_end = fdt64_to_cpu(*((const fdt64_t *) propEnd));
> > +
> > + ret = of_remove_property(of_chosen, propEnd);
> > + if (!ret) {
> > + return ret;
> > + }
>
> There seems to be quite a bit of code duplication in this function and
> in ima_get_kexec_buffer().  It could probably be cleaned up with some
> refactoring.

Sorry, my mistake.  One calls of_get_property(), while the other calls
of_find_property().

Mimi

\
 
 \ /
  Last update: 2019-09-18 23:22    [W:0.086 / U:2.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site