From: Felipe Balbi <balbi@kernel.org>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org
Subject: Re: [PATCH v2 1/2] usb: gadget: mv_u3d: add check for dma mapping error
Date: Thu, 03 Nov 2016 15:34:00 +0200 [thread overview]
Message-ID: <87zilgk7qv.fsf@linux.intel.com> (raw)
In-Reply-To: <1478178992-28317-1-git-send-email-khoroshilov@ispras.ru>
[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]
Hi,
Alexey Khoroshilov <khoroshilov@ispras.ru> writes:
> mv_u3d_req_to_trb() does not check for dma mapping errors.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> v2: split fix and clenup to separate patches.
I'll fix this time when applying, but keep in mind we don't want these
notes in the commit log. They should come after the tearline (---)
below, together with the diffstat ;-)
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> ---
> drivers/usb/gadget/udc/mv_u3d_core.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c
> index b9e19a591322..6f3be0ba9ac8 100644
> --- a/drivers/usb/gadget/udc/mv_u3d_core.c
> +++ b/drivers/usb/gadget/udc/mv_u3d_core.c
> @@ -462,6 +462,12 @@ static int mv_u3d_req_to_trb(struct mv_u3d_req *req)
> req->trb_head->trb_hw,
> trb_num * sizeof(*trb_hw),
> DMA_BIDIRECTIONAL);
> + if (dma_mapping_error(u3d->gadget.dev.parent,
> + req->trb_head->trb_dma)) {
> + kfree(req->trb_head->trb_hw);
> + kfree(req->trb_head);
> + return -EFAULT;
> + }
>
> req->chain = 1;
> }
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]
next prev parent reply other threads:[~2016-11-03 13:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-28 23:12 [PATCH] usb: gadget: mv_u3d: add check for dma mapping error Alexey Khoroshilov
2016-11-03 8:52 ` Felipe Balbi
2016-11-03 13:16 ` [PATCH v2 1/2] " Alexey Khoroshilov
2016-11-03 13:16 ` [PATCH v2 2/2] usb: gadget: mv_u3d: mv_u3d_start_queue() refactoring Alexey Khoroshilov
2016-11-03 13:34 ` Felipe Balbi [this message]
2016-11-03 18:09 ` [PATCH v2 1/2] usb: gadget: mv_u3d: add check for dma mapping error Alexey Khoroshilov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zilgk7qv.fsf@linux.intel.com \
--to=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=khoroshilov@ispras.ru \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.