提交 c5b250ad 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

[media] solo6x10: check dma_map_sg() return value

The dma_map_sg() function can fail, so check for the return value.
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 761f9aa2
...@@ -478,8 +478,9 @@ static int solo_fill_jpeg(struct solo_enc_dev *solo_enc, ...@@ -478,8 +478,9 @@ static int solo_fill_jpeg(struct solo_enc_dev *solo_enc,
vb2_set_plane_payload(vb, 0, vop_jpeg_size(vh) + solo_enc->jpeg_len); vb2_set_plane_payload(vb, 0, vop_jpeg_size(vh) + solo_enc->jpeg_len);
/* may discard all previous data in vbuf->sgl */ /* may discard all previous data in vbuf->sgl */
dma_map_sg(&solo_dev->pdev->dev, vbuf->sgl, vbuf->nents, if (!dma_map_sg(&solo_dev->pdev->dev, vbuf->sgl, vbuf->nents,
DMA_FROM_DEVICE); DMA_FROM_DEVICE))
return -ENOMEM;
ret = solo_send_desc(solo_enc, solo_enc->jpeg_len, vbuf, ret = solo_send_desc(solo_enc, solo_enc->jpeg_len, vbuf,
vop_jpeg_offset(vh) - SOLO_JPEG_EXT_ADDR(solo_dev), vop_jpeg_offset(vh) - SOLO_JPEG_EXT_ADDR(solo_dev),
frame_size, SOLO_JPEG_EXT_ADDR(solo_dev), frame_size, SOLO_JPEG_EXT_ADDR(solo_dev),
...@@ -525,8 +526,9 @@ static int solo_fill_mpeg(struct solo_enc_dev *solo_enc, ...@@ -525,8 +526,9 @@ static int solo_fill_mpeg(struct solo_enc_dev *solo_enc,
frame_size = ALIGN(vop_mpeg_size(vh) + skip, DMA_ALIGN); frame_size = ALIGN(vop_mpeg_size(vh) + skip, DMA_ALIGN);
/* may discard all previous data in vbuf->sgl */ /* may discard all previous data in vbuf->sgl */
dma_map_sg(&solo_dev->pdev->dev, vbuf->sgl, vbuf->nents, if (!dma_map_sg(&solo_dev->pdev->dev, vbuf->sgl, vbuf->nents,
DMA_FROM_DEVICE); DMA_FROM_DEVICE))
return -ENOMEM;
ret = solo_send_desc(solo_enc, skip, vbuf, frame_off, frame_size, ret = solo_send_desc(solo_enc, skip, vbuf, frame_off, frame_size,
SOLO_MP4E_EXT_ADDR(solo_dev), SOLO_MP4E_EXT_ADDR(solo_dev),
SOLO_MP4E_EXT_SIZE(solo_dev)); SOLO_MP4E_EXT_SIZE(solo_dev));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册