Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ata/src/ata.c

    r3d2d455b r0dab4850  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    257257
    258258        for (i = 0; i < MAX_DEVICES; i++) {
     259                if (chan->device[i].present == false)
     260                        continue;
     261
    259262                rc = ata_device_remove(&chan->device[i]);
    260263                if (rc != EOK) {
    261264                        ata_msg_error(chan, "Unable to remove device %d.", i);
    262                         break;
     265                        fibril_mutex_unlock(&chan->lock);
     266                        return rc;
    263267                }
    264268        }
     
    266270        ata_bd_fini_irq(chan);
    267271        fibril_mutex_unlock(&chan->lock);
     272        free(chan);
    268273
    269274        return rc;
     
    15321537         * exceed DMA buffer size.
    15331538         */
    1534         dma_maxnb = d->chan->params.max_dma_xfer / d->block_size;
    1535         if (dma_maxnb < maxnb)
    1536                 maxnb = dma_maxnb;
     1539        if (d->chan->params.use_dma) {
     1540                dma_maxnb = d->chan->params.max_dma_xfer / d->block_size;
     1541                if (dma_maxnb < maxnb)
     1542                        maxnb = dma_maxnb;
     1543        }
    15371544
    15381545        return maxnb;
Note: See TracChangeset for help on using the changeset viewer.