dma-buf/dma-resv: Respect num_fences when initializing the shared fence list.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tue, 24 Nov 2020 11:57:07 +0000 (12:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:54:26 +0000 (11:54 +0100)
commit0c500d6a5c7a1e363652781e4dd03b7ec37f3c04
treeaee82044341a3ee36d61245535241dcecc2ee855
parent224adad2c975ec706ba3c451ce8e10f1d3d9806d
dma-buf/dma-resv: Respect num_fences when initializing the shared fence list.

commit bf8975837dac156c33a4d15d46602700998cb6dd upstream.

We hardcode the maximum number of shared fences to 4, instead of
respecting num_fences. Use a minimum of 4, but more if num_fences
is higher.

This seems to have been an oversight when first implementing the
api.

Fixes: 04a5faa8cbe5 ("reservation: update api and add some helpers")
Cc: <stable@vger.kernel.org> # v3.17+
Reported-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201124115707.406917-1-maarten.lankhorst@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma-buf/dma-resv.c