Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1317064

Re: [PATCH v2] mptlan: add checks for dma mapping errors

From Alexey Khoroshilov <khoroshilov@ispras.ru>
Newsgroups linux.kernel
Subject Re: [PATCH v2] mptlan: add checks for dma mapping errors
Date 2016-01-25 18:10 +0100
Message-ID <qUSOq-7cE-101@gated-at.bofh.it> (permalink)
References <qTUyS-3mj-11@gated-at.bofh.it> <qURpg-60C-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 25.01.2016 16:36, Tomas Henzl wrote:
> On 23.1.2016 01:41, Alexey Khoroshilov wrote:
>> mpt_lan_sdu_send() and mpt_lan_post_receive_buckets() do not check
>> if mapping dma memory succeed.
>> The patch adds the checks and failure handling.
>>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
>> ---
>>  drivers/message/fusion/mptlan.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
>> index cbe96072a6cc..3b6c8a755713 100644
>> --- a/drivers/message/fusion/mptlan.c
>> +++ b/drivers/message/fusion/mptlan.c
>> @@ -734,6 +734,12 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
>>  
>>          dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len,
>>  			     PCI_DMA_TODEVICE);
>> +	if (pci_dma_mapping_error(mpt_dev->pcidev, dma)) {
>> +		netif_stop_queue(dev);
> 
> Hi Alexey,
> isn't a mpt_put_msg_frame needed here ?
> and a similar de-alloc in next chunk too?
> -tms

Hi Tomas,

You are right, thank you!
I'll resend the patch.

--
Alexey

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] mptlan: add checks for dma mapping errors Alexey Khoroshilov <khoroshilov@ispras.ru> - 2016-01-23 01:50 +0100
  Re: [PATCH v2] mptlan: add checks for dma mapping errors Tomas Henzl <thenzl@redhat.com> - 2016-01-25 16:40 +0100
    Re: [PATCH v2] mptlan: add checks for dma mapping errors Alexey Khoroshilov <khoroshilov@ispras.ru> - 2016-01-25 18:10 +0100
      [PATCH v3] mptlan: add checks for dma mapping errors Alexey Khoroshilov <khoroshilov@ispras.ru> - 2016-01-25 19:10 +0100
        Re: [PATCH v3] mptlan: add checks for dma mapping errors Tomas Henzl <thenzl@redhat.com> - 2016-01-26 17:40 +0100
          Re: [PATCH v3] mptlan: add checks for dma mapping errors "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-01-27 03:30 +0100
            RE: [PATCH v3] mptlan: add checks for dma mapping errors Sathya Prakash <sathya.prakash@avagotech.com> - 2016-01-27 06:50 +0100
              Re: [PATCH v3] mptlan: add checks for dma mapping errors Tomas Henzl <thenzl@redhat.com> - 2016-01-27 17:20 +0100
                Re: [PATCH v3] mptlan: add checks for dma mapping errors James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-01-27 17:30 +0100

csiph-web