staging: android: ion: Avoid calling free_duped_table() twice
authorArchit Taneja <architt@codeaurora.org>
Wed, 17 May 2017 08:15:48 +0000 (13:45 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 May 2017 13:59:38 +0000 (15:59 +0200)
commitdf794cfbb9660f098412481be7d41bcb8e842cc9
tree5ab03a39d96154832f7acf1d575103825078c2f8
parent83d952ee0f09a7a36970d3d85ddbfffc8bedf32b
staging: android: ion: Avoid calling free_duped_table() twice

Currently, the duplicated sg table is freed in the detach() and
the error path of map_dma_buf() ion's dma_buf_ops.

If a call to dma_buf_map_attachment() fails, the importer is
expected to call dma_buf_detach() to remove the attachment. This
will result in us trying to free the duped sg table twice.

Don't call free_duped_table() in ion_map_dma_buf() to avoid this.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ion/ion.c