From: Jani Nikula <jani.nikula@intel.com>
To: Dan Carpenter <error27@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [bug report] drm/i915/dmc: add i915_to_dmc() and dmc->i915 and use them
Date: Thu, 09 Mar 2023 16:51:10 +0200 [thread overview]
Message-ID: <875yba9dwh.fsf@intel.com> (raw)
In-Reply-To: <d1cc6919-6392-41f0-b17e-86e5b706e945@kili.mountain>
On Thu, 09 Mar 2023, Dan Carpenter <error27@gmail.com> wrote:
> Hello Jani Nikula,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 1b28c1c789d0: "drm/i915/dmc: add i915_to_dmc() and
> dmc->i915 and use them" from Mar 1, 2023, leads to the following
> Smatch complaint:
>
> drivers/gpu/drm/i915/display/intel_dmc.c:1162 intel_dmc_debugfs_status_show()
> error: we previously assumed 'dmc' could be null (see line 1148)
>
> drivers/gpu/drm/i915/display/intel_dmc.c
> 1142
> 1143 wakeref = intel_runtime_pm_get(&i915->runtime_pm);
> 1144
> 1145 seq_printf(m, "DMC initialized: %s\n", str_yes_no(dmc));'
> ^^^^^^^^^^^^^^^
> This is a check for NULL too.
>
> 1146 seq_printf(m, "fw loaded: %s\n",
> 1147 str_yes_no(intel_dmc_has_payload(i915)));
> 1148 seq_printf(m, "path: %s\n", dmc ? dmc->fw_path : "N/A");
> ^^^
> The patch adds a check for NULL.
>
> 1149 seq_printf(m, "Pipe A fw needed: %s\n",
> 1150 str_yes_no(GRAPHICS_VER(i915) >= 12));
> 1151 seq_printf(m, "Pipe A fw loaded: %s\n",
> 1152 str_yes_no(has_dmc_id_fw(i915, DMC_FW_PIPEA)));
> 1153 seq_printf(m, "Pipe B fw needed: %s\n",
> 1154 str_yes_no(IS_ALDERLAKE_P(i915) ||
> 1155 DISPLAY_VER(i915) >= 14));
> 1156 seq_printf(m, "Pipe B fw loaded: %s\n",
> 1157 str_yes_no(has_dmc_id_fw(i915, DMC_FW_PIPEB)));
> 1158
> 1159 if (!intel_dmc_has_payload(i915))
intel_dmc_has_payload() should always return false for dmc == NULL.
BR,
Jani.
> 1160 goto out;
> 1161
> 1162 seq_printf(m, "version: %d.%d\n", DMC_VERSION_MAJOR(dmc->version),
> ^^^^^^^^^^^^
> 1163 DMC_VERSION_MINOR(dmc->version));
> ^^^^^^^^^^^^
> Unchecked dereferences.
>
> 1164
>
> regards,
> dan carpenter
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-03-09 15:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 14:46 [Intel-gfx] [bug report] drm/i915/dmc: add i915_to_dmc() and dmc->i915 and use them Dan Carpenter
2023-03-09 14:51 ` Jani Nikula [this message]
2023-03-10 15:19 ` Dan Carpenter
2023-03-10 16:36 ` Jani Nikula
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=875yba9dwh.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=error27@gmail.com \
--cc=intel-gfx@lists.freedesktop.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 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.