Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751287AbbGLN6Y (ORCPT ); Sun, 12 Jul 2015 09:58:24 -0400 Received: from mout.gmx.net ([212.227.15.15]:56623 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160AbbGLN6W (ORCPT ); Sun, 12 Jul 2015 09:58:22 -0400 Date: Sun, 12 Jul 2015 15:58:06 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Robert Jarzmik cc: Mauro Carvalho Chehab , Jiri Kosina , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Jarzmik Subject: Re: [PATCH v2 1/4] media: pxa_camera: fix the buffer free path In-Reply-To: <1436120872-24484-2-git-send-email-robert.jarzmik@free.fr> Message-ID: References: <1436120872-24484-1-git-send-email-robert.jarzmik@free.fr> <1436120872-24484-2-git-send-email-robert.jarzmik@free.fr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Provags-ID: V03:K0:PF7dNc7+PU5fQ9EDlVEcLDiNCs8qfdzYUdemdHqNnuOp0knlnzi 8I5waU6OU4odNt05JVtZrXVbQtK/1sVwI7tieWTMU7BUFmqdjXL//G07QTTm+yItaDGDm7g FR5w7Pq6HICrgYEIii4L5Wbb3qfMo3GVDgxHdk3NelpLgb/ZqQv3mXx5O2wXo0KI8PT1HuR 5XSaBD8oqjJfbKwfB9oAg== X-UI-Out-Filterresults: notjunk:1;V01:K0:zxQ7WC4f/0s=:4Rz5SzBdFS9HNa7/ZuY5yB kb8RlLHv0byoywGJ3KucynJFi6xfHGEBsHvrsKiJJWsB6IYtZ2bHqqyrfFzFaI7H27L2mPPI5 9Y7G+Th5cNL4TiKxkG9A7ASa3f5BUdFsmmm+eUyJ/YBHnccynXd0/r+WgXLLFM4c+X9thrIy2 /exaC3PvjYPfJOhwauyEE0bDfDnBNVMQev7UnCY9/w9oat8QLl8IRAaEu0HpgzBWmym7fYpSU oaQbNy6Hl/lmWz2kVk6sIWK9KAXGcaqo5hvY1OBdVCfz6ZB7zhe2QWLkpfzTBQ+0QPkGE3CII 5ETbOEFH1di6Wctl7WA6Mnbzwmu/7KVIddBDI73ymAEQ9FdZqXQIhQ9evGMgTwbw5qnIEzalD rWMUzFjLJJjdR9JCQl4RvhkPkHgTdbVHZdufCYulbhohdpP4tvj4vyNKjyJRNhfn8BvEOmpj2 3x1nI/5+9NE4AAl0R0Elsff4gN3bj2Wok8se4qdjPvb1lpqueXPOj5rbJ/N4dqVuOZZ4aGHKe 8/PJJPIHLMsDbnfr77O8ZawZJIq4uKWuXsgGNZ/gjwKNQhkyyE3iL/LCtd2+4f+lAkTvyyqZq KTGgasxiT3GzVpFqBK3HYtqnunSiGBXbjblS1sGJWOMkgYzcAHY32Fqfc7Evosx8fIDQqALcl rFBDdmeR7p4VAkiRkeE023MSzQd9EsLqrJscT3CuJ+Mf6HNt6KculrimxS+sNRBkZkE4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1789 Lines: 54 Hi Robert, On Sun, 5 Jul 2015, Robert Jarzmik wrote: > From: Robert Jarzmik > > Fix the error path where the video buffer wasn't allocated nor > mapped. In this case, in the driver free path don't try to unmap memory > which was not mapped in the first place. Have I missed your reply to my comments to v1 of this patch? This one seems to be its exact copy? Thanks Guennadi > > Signed-off-by: Robert Jarzmik > --- > drivers/media/platform/soc_camera/pxa_camera.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c > index 8d6e343..3ca33f0 100644 > --- a/drivers/media/platform/soc_camera/pxa_camera.c > +++ b/drivers/media/platform/soc_camera/pxa_camera.c > @@ -272,8 +272,8 @@ static void free_buffer(struct videobuf_queue *vq, struct pxa_buffer *buf) > * longer in STATE_QUEUED or STATE_ACTIVE > */ > videobuf_waiton(vq, &buf->vb, 0, 0); > - videobuf_dma_unmap(vq->dev, dma); > - videobuf_dma_free(dma); > + if (buf->vb.state == VIDEOBUF_NEEDS_INIT) > + return; > > for (i = 0; i < ARRAY_SIZE(buf->dmas); i++) { > if (buf->dmas[i].sg_cpu) > @@ -283,6 +283,8 @@ static void free_buffer(struct videobuf_queue *vq, struct pxa_buffer *buf) > buf->dmas[i].sg_dma); > buf->dmas[i].sg_cpu = NULL; > } > + videobuf_dma_unmap(vq->dev, dma); > + videobuf_dma_free(dma); > > buf->vb.state = VIDEOBUF_NEEDS_INIT; > } > -- > 2.1.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/