All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [bug report] drm/nouveau/secboot: add gp102/gp104/gp106/gp107 support
Date: Fri, 10 Mar 2017 23:55:06 +0300	[thread overview]
Message-ID: <20170310205506.GA28366@mwanda> (raw)

Hello Alexandre Courbot,

The patch 5429f82f3415: "drm/nouveau/secboot: add
gp102/gp104/gp106/gp107 support" from Jan 26, 2017, leads to the
following static checker warning:

	drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp102.c:63 gp102_run_secure_scrub()
	warn: passing zero to 'PTR_ERR'

drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp102.c
    46  static int
    47  gp102_run_secure_scrub(struct nvkm_secboot *sb)
    48  {
    49          struct nvkm_subdev *subdev = &sb->subdev;
    50          struct nvkm_device *device = subdev->device;
    51          struct nvkm_engine *engine;
    52          struct nvkm_falcon *falcon;
    53          void *scrub_image;
    54          struct fw_bin_header *hsbin_hdr;
    55          struct hsf_fw_header *fw_hdr;
    56          struct hsf_load_header *lhdr;
    57          void *scrub_data;
    58          int ret;
    59  
    60          nvkm_debug(subdev, "running VPR scrubber binary on NVDEC...\n");
    61  
    62          if (!(engine = nvkm_engine_ref(&device->nvdec->engine)))
    63                  return PTR_ERR(engine);

This code doesn't make sense.  nvkm_engine_ref() isn't going to return
NULL because we're not passing a NULL to it.  I guess we should be
checking for ERR_PTR().  But really why does nvkm_engine_ref() ever
return NULL?  It feels like if we pass it a NULL pointer it should
return ERR_PTR(-EINVAL) on that path instead.

    64          falcon = device->nvdec->falcon;
    65  

regards,
dan carpenter
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

             reply	other threads:[~2017-03-10 20:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 20:55 Dan Carpenter [this message]
2017-03-13  9:15 ` [Nouveau] [bug report] drm/nouveau/secboot: add gp102/gp104/gp106/gp107 support Alexandre Courbot

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=20170310205506.GA28366@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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.