Re: amdkfd: Add packet manager module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks.
Prepared a patch to fix it and will send it shortly.

Oded

On 12/02/2014 01:28 PM, Dan Carpenter wrote:
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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux