dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ben.goz@amd.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: amdkfd: Add packet manager module
Date: Tue, 2 Dec 2014 14:28:42 +0300	[thread overview]
Message-ID: <20141202112842.GA21948@mwanda> (raw)

Hello Ben Goz,

The patch 241f24f82363: "amdkfd: Add packet manager module" from Jul
17, 2014, leads to the following static checker warning:

	drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c:357 pm_send_set_resources()
	error: potentially using uninitialized 'packet'.

drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
   344  int pm_send_set_resources(struct packet_manager *pm,
   345                                  struct scheduling_resources *res)
   346  {
   347          struct pm4_set_resources *packet;
   348  
   349          BUG_ON(!pm || !res);
   350  
   351          pr_debug("kfd: In func %s\n", __func__);
   352  
   353          mutex_lock(&pm->lock);
   354          pm->priv_queue->acquire_packet_buffer(pm->priv_queue,
   355                                          sizeof(*packet) / sizeof(uint32_t),
   356                          (unsigned int **)&packet);

If we added error handling to ->acquire_packet_buffer() or if that
function set packet to NULL on error, either one of those would silence
this static checker warning (from pre-release Smatch checks).

   357          if (packet == NULL) {
   358                  mutex_unlock(&pm->lock);
   359                  pr_err("kfd: failed to allocate buffer on kernel queue\n");
   360                  return -ENOMEM;
   361          }
   362  

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2014-12-02 11:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 11:28 Dan Carpenter [this message]
2014-12-04 12:11 ` amdkfd: Add packet manager module Oded Gabbay

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=20141202112842.GA21948@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ben.goz@amd.com \
    --cc=dri-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox