v4l: xilinx: missing error code
PATCH 1/1 v4l: xilinx: missing error code
We should set "ret" on this error path instead of returning success.
drivers/media/platform/xilinx/xilinx-dma.c +3 -1
@@ -699,8 +699,10 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,/* ... and the buffers queue... */ dma->alloc_ctx =vb2_dma_contig_init_ctx (dma->xdev->dev); -if (IS_ERR (dma->alloc_ctx)) +if (IS_ERR (dma->alloc_ctx)) { + ret =PTR_ERR (dma->alloc_ctx); goto error; + }/* Don't enable VB2_READ and VB2_WRITE, as using the read() and write() * V4L2 APIs would be inefficient. Testing on the command line with a
SGkgRGFuLA0KDQpUaGFua3MgZm9yIHRoZSBwYXRjaC4NCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3Nh Z2UtLS0tLQ0KPiBGcm9tOiBEYW4gQ2FycGVudGVyIFttYWlsdG86ZGFuLmNhcnBlbnRlckBvcmFj bGUuY29tXQ0KPiBTZW50OiBXZWRuZXNkYXksIEp1bmUgMjQsIDIwMTUgNzoyOSBBTQ0KPiBUbzog SHl1biBLd29uDQo+IENjOiBMYXVyZW50IFBpbmNoYXJ0OyBNYXVybyBDYXJ2YWxobyBDaGVoYWI7 IE1pY2hhbCBTaW1lazsgU29yZW4gQnJpbmttYW5uOw0KPiBsaW51eC1tZWRpYUB2Z2VyLmtlcm5l bC5vcmc7IGtlcm5lbC1qYW5pdG9yc0B2Z2VyLmtlcm5lbC5vcmcNCj4gU3ViamVjdDogW3BhdGNo XSBbbWVkaWFdIHY0bDogeGlsaW54OiBtaXNzaW5nIGVycm9yIGNvZGUNCj4NCj4gV2Ugc2hvdWxk IHNldCAicmV0IiBvbiB0aGlzIGVycm9yIHBhdGggaW5zdGVhZCBvZiByZXR1cm5pbmcgc3VjY2Vz cy4NCj4NCj4gRml4ZXM6IGRmMzMwNTE1NmY5OCAoJ1ttZWRpYV0gdjRsOiB4aWxpbng6IEFkZCBY aWxpbnggVmlkZW8gSVAgY29yZScpDQo+IFNpZ25lZC1vZmYtYnk6IERhbiBDYXJwZW50ZXIgPGRh bi5jYXJwZW50ZXJAb3JhY2xlLmNvbT4NCg0KQWNrZWQtYnk6IEh5dW4gS3dvbiA8aHl1bi5rd29u QHhpbGlueC5jb20+DQoNClRoYW5rcywNCi1oeXVuDQoNCg0KDQpUaGlzIGVtYWlsIGFuZCBhbnkg YXR0YWNobWVudHMgYXJlIGludGVuZGVkIGZvciB0aGUgc29sZSB1c2Ugb2YgdGhlIG5hbWVkIHJl Y2lwaWVudChzKSBhbmQgY29udGFpbihzKSBjb25maWRlbnRpYWwgaW5mb3JtYXRpb24gdGhhdCBt YXkgYmUgcHJvcHJpZXRhcnksIHByaXZpbGVnZWQgb3IgY29weXJpZ2h0ZWQgdW5kZXIgYXBwbGlj YWJsZSBsYXcuIElmIHlvdSBhcmUgbm90IHRoZSBpbnRlbmRlZCByZWNpcGllbnQsIGRvIG5vdCBy ZWFkLCBjb3B5LCBvciBmb3J3YXJkIHRoaXMgZW1haWwgbWVzc2FnZSBvciBhbnkgYXR0YWNobWVu dHMuIERlbGV0ZSB0aGlzIGVtYWlsIG1lc3NhZ2UgYW5kIGFueSBhdHRhY2htZW50cyBpbW1lZGlh dGVseS4NCg0K
Hi Dan,
Thank you for the patch.
Quoted 4 lines · On Wednesday 24 June 2015 17:28:31 Dan Carpenter wrote:
We should set "ret" on this error path instead of returning success.
Fixes df3305156f98 ('[media] v4l: xilinx: Add Xilinx Video IP core')Signed-off-by Dan Carpenter <[email protected]>
and applied to my tree.
Quoted 17 lines
(quoted diff) +0
-0
b/drivers/media/platform/xilinx/xilinx-dma.cindex 98e50e4..e779c93 100644drivers/media/platform/xilinx/xilinx-dma.c +3
-1@@ -699,8 +699,10 @@ int xvip_dma_init(struct xvip_composite_device *xdev,struct xvip_dma *dma,/* ... and the buffers queue... */ dma->alloc_ctx = vb2_dma_contig_init_ctx(dma->xdev->dev); -if (IS_ERR (dma->alloc_ctx)) +if (IS_ERR (dma->alloc_ctx)) { + ret =PTR_ERR (dma->alloc_ctx); goto error; + }/* Don't enable VB2_READ and VB2_WRITE, as using the read() and write() * V4L2 APIs would be inefficient. Testing on the command line with a
Signature · 3 lines
Regards, Laurent Pinchart