aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/rtsx_pci_sdmmc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index b435806dd9f3..1d3d6c4bfdc6 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -54,9 +54,9 @@ struct realtek_pci_sdmmc {
54#define SDMMC_POWER_ON 1 54#define SDMMC_POWER_ON 1
55#define SDMMC_POWER_OFF 0 55#define SDMMC_POWER_OFF 0
56 56
57 unsigned int sg_count; 57 int sg_count;
58 s32 cookie; 58 s32 cookie;
59 unsigned int cookie_sg_count; 59 int cookie_sg_count;
60 bool using_cookie; 60 bool using_cookie;
61}; 61};
62 62
@@ -557,6 +557,13 @@ static int sd_rw_multi(struct realtek_pci_sdmmc *host, struct mmc_request *mrq)
557{ 557{
558 struct mmc_data *data = mrq->data; 558 struct mmc_data *data = mrq->data;
559 559
560 if (host->sg_count < 0) {
561 data->error = host->sg_count;
562 dev_dbg(sdmmc_dev(host), "%s: sg_count = %d is invalid\n",
563 __func__, host->sg_count);
564 return data->error;
565 }
566
560 if (data->flags & MMC_DATA_READ) 567 if (data->flags & MMC_DATA_READ)
561 return sd_read_long_data(host, mrq); 568 return sd_read_long_data(host, mrq);
562 569