Re: dma-buf: cleanup dma_buf_export() to make it easily extensible

2015-02-20 Thread Sumit Semwal
Hi Dan,

On 21 February 2015 at 00:56, Dan Carpenter dan.carpen...@oracle.com wrote:
 Hello Sumit Semwal,

 The patch 817bd7253291: dma-buf: cleanup dma_buf_export() to make it
 easily extensible from Jan 23, 2015, leads to the following static
 checker warning:

 drivers/staging/android/ion/ion.c:1112 ion_share_dma_buf()
 error: potentially dereferencing uninitialized 'buffer'.

Thanks for catching this! I am preparing a patch which I will submit asap.
 drivers/staging/android/ion/ion.c
   1103  struct dma_buf *ion_share_dma_buf(struct ion_client *client,
   1104  struct ion_handle 
 *handle)
   1105  {
   1106  struct ion_buffer *buffer;
^^
   1107  struct dma_buf *dmabuf;
   1108  bool valid_handle;
   1109  DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
   1110
     exp_info.ops = dma_buf_ops;
   1112  exp_info.size = buffer-size;
 ^^
   1113  exp_info.flags = O_RDWR;
   1114  exp_info.priv = buffer;
 ^^
 And here also.

   1115

 regards,
 dan carpenter



-- 
Thanks and regards,

Sumit Semwal
Kernel Team Lead - Linaro Mobile Group
Linaro.org │ Open source software for ARM SoCs
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


re: dma-buf: cleanup dma_buf_export() to make it easily extensible

2015-02-20 Thread Dan Carpenter
Hello Sumit Semwal,

The patch 817bd7253291: dma-buf: cleanup dma_buf_export() to make it
easily extensible from Jan 23, 2015, leads to the following static
checker warning:

drivers/staging/android/ion/ion.c:1112 ion_share_dma_buf()
error: potentially dereferencing uninitialized 'buffer'.

drivers/staging/android/ion/ion.c
  1103  struct dma_buf *ion_share_dma_buf(struct ion_client *client,
  1104  struct ion_handle 
*handle)
  1105  {
  1106  struct ion_buffer *buffer;
   ^^
  1107  struct dma_buf *dmabuf;
  1108  bool valid_handle;
  1109  DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
  1110  
    exp_info.ops = dma_buf_ops;
  1112  exp_info.size = buffer-size;
^^
  1113  exp_info.flags = O_RDWR;
  1114  exp_info.priv = buffer;
^^
And here also.

  1115  

regards,
dan carpenter
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel