public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
To: Rob Herring <robh@kernel.org>, Dan Carpenter <dan.carpenter@oracle.com>
Cc: kbuild@lists.01.org, lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Thiago Jung Bauermann <bauerman@linux.ibm.com>
Subject: Re: arch/arm64/kernel/machine_kexec_file.c:152 load_other_segments() warn: missing error code 'ret'
Date: Mon, 6 Dec 2021 12:33:07 -0800	[thread overview]
Message-ID: <29aa717b-a862-e6b0-0286-9dd948968efa@linux.microsoft.com> (raw)
In-Reply-To: <CAL_JsqKzsCvS2QKUo7x4eJ2s6p4=3_d38hyMvsVt7RySjHoGgw@mail.gmail.com>

Yes Rob - will do it this week.

thanks,
  -lakshmi

On 12/6/2021 12:31 PM, Rob Herring wrote:
> On Wed, Dec 1, 2021 at 5:47 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   c5c17547b778975b3d83a73c8d84e8fb5ecf3ba5
>> commit: ac10be5cdbfa852139658d52c2f1c608782ce992 arm64: Use common of_kexec_alloc_and_setup_fdt()
>> config: arm64-randconfig-m031-20211127 (https://download.01.org/0day-ci/archive/20211128/202111280304.FL2314qf-lkp@intel.com/config)
>> compiler: aarch64-linux-gcc (GCC) 11.2.0
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>>
>> smatch warnings:
>> arch/arm64/kernel/machine_kexec_file.c:152 load_other_segments() warn: missing error code 'ret'
> 
> Lakshmi, Can you please prepare a fix for this. It's been reported since July.
> 
>>
>> vim +/ret +152 arch/arm64/kernel/machine_kexec_file.c
>>
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   81  int load_other_segments(struct kimage *image,
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   82                          unsigned long kernel_load_addr,
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   83                          unsigned long kernel_size,
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   84                          char *initrd, unsigned long initrd_len,
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   85                          char *cmdline)
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   86  {
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   87          struct kexec_buf kbuf;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16   88          void *headers, *dtb = NULL;
>> 108aa503657ee2 Benjamin Gwin           2020-11-03   89          unsigned long headers_sz, initrd_load_addr = 0, dtb_len,
>> 108aa503657ee2 Benjamin Gwin           2020-11-03   90                        orig_segments = image->nr_segments;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   91          int ret = 0;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   92
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   93          kbuf.image = image;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   94          /* not allocate anything below the kernel */
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   95          kbuf.buf_min = kernel_load_addr + kernel_size;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15   96
>> 3751e728cef290 AKASHI Takahiro         2019-12-16   97          /* load elf core header */
>> 3751e728cef290 AKASHI Takahiro         2019-12-16   98          if (image->type == KEXEC_TYPE_CRASH) {
>> 3751e728cef290 AKASHI Takahiro         2019-12-16   99                  ret = prepare_elf_headers(&headers, &headers_sz);
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  100                  if (ret) {
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  101                          pr_err("Preparing elf core header failed\n");
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  102                          goto out_err;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  103                  }
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  104
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  105                  kbuf.buffer = headers;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  106                  kbuf.bufsz = headers_sz;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  107                  kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  108                  kbuf.memsz = headers_sz;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  109                  kbuf.buf_align = SZ_64K; /* largest supported page size */
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  110                  kbuf.buf_max = ULONG_MAX;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  111                  kbuf.top_down = true;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  112
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  113                  ret = kexec_add_buffer(&kbuf);
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  114                  if (ret) {
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  115                          vfree(headers);
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  116                          goto out_err;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  117                  }
>> 7b558cc3564e6c Lakshmi Ramasubramanian 2021-02-21  118                  image->elf_headers = headers;
>> 7b558cc3564e6c Lakshmi Ramasubramanian 2021-02-21  119                  image->elf_load_addr = kbuf.mem;
>> 7b558cc3564e6c Lakshmi Ramasubramanian 2021-02-21  120                  image->elf_headers_sz = headers_sz;
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  121
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  122                  pr_debug("Loaded elf core header at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
>> 7b558cc3564e6c Lakshmi Ramasubramanian 2021-02-21  123                           image->elf_load_addr, kbuf.bufsz, kbuf.memsz);
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  124          }
>> 3751e728cef290 AKASHI Takahiro         2019-12-16  125
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  126          /* load initrd */
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  127          if (initrd) {
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  128                  kbuf.buffer = initrd;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  129                  kbuf.bufsz = initrd_len;
>> c19d050f808812 Bhupesh Sharma          2019-07-11  130                  kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  131                  kbuf.memsz = initrd_len;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  132                  kbuf.buf_align = 0;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  133                  /* within 1GB-aligned window of up to 32GB in size */
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  134                  kbuf.buf_max = round_down(kernel_load_addr, SZ_1G)
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  135                                                  + (unsigned long)SZ_1G * 32;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  136                  kbuf.top_down = false;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  137
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  138                  ret = kexec_add_buffer(&kbuf);
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  139                  if (ret)
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  140                          goto out_err;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  141                  initrd_load_addr = kbuf.mem;
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  142
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  143                  pr_debug("Loaded initrd at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
>> 51075e0cb759a7 Łukasz Stelmach         2020-04-30  144                                  initrd_load_addr, kbuf.bufsz, kbuf.memsz);
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  145          }
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  146
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  147          /* load dtb */
>> ac10be5cdbfa85 Rob Herring             2021-02-21  148          dtb = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr,
>> ac10be5cdbfa85 Rob Herring             2021-02-21  149                                             initrd_len, cmdline, 0);
>> ac10be5cdbfa85 Rob Herring             2021-02-21  150          if (!dtb) {
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15  151                  pr_err("Preparing for new dtb failed\n");
>> 52b2a8af743604 AKASHI Takahiro         2018-11-15 @152                  goto out_err;
>>                                                                          ^^^^^^^^^^^^^
>> This needs an error code.
>>
>> ---
>> 0-DAY CI Kernel Test Service, Intel Corporation
>> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>>

  reply	other threads:[~2021-12-06 20:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 11:46 arch/arm64/kernel/machine_kexec_file.c:152 load_other_segments() warn: missing error code 'ret' Dan Carpenter
2021-12-06 20:31 ` Rob Herring
2021-12-06 20:33   ` Lakshmi Ramasubramanian [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-03 13:01 Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29aa717b-a862-e6b0-0286-9dd948968efa@linux.microsoft.com \
    --to=nramas@linux.microsoft.com \
    --cc=bauerman@linux.ibm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox