diff options
author | John Crispin <john@openwrt.org> | 2016-04-26 11:43:38 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2016-04-26 11:43:38 +0000 |
commit | 301d48b8f03c7460efac50007154ab2426db188a (patch) | |
tree | 3b0e00138bd3020f682470e90bcf357cd2529a2f /target/linux/mediatek/patches-4.4/0083-net-next-mediatek-add-missing-return-code-check.patch | |
parent | 0a4f2b5920a8c4fa5afc021bc95a6aa781984013 (diff) | |
download | mtk-20170518-301d48b8f03c7460efac50007154ab2426db188a.zip mtk-20170518-301d48b8f03c7460efac50007154ab2426db188a.tar.gz mtk-20170518-301d48b8f03c7460efac50007154ab2426db188a.tar.bz2 |
mediatek: update patches
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 49243
Diffstat (limited to 'target/linux/mediatek/patches-4.4/0083-net-next-mediatek-add-missing-return-code-check.patch')
-rw-r--r-- | target/linux/mediatek/patches-4.4/0083-net-next-mediatek-add-missing-return-code-check.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/target/linux/mediatek/patches-4.4/0083-net-next-mediatek-add-missing-return-code-check.patch b/target/linux/mediatek/patches-4.4/0083-net-next-mediatek-add-missing-return-code-check.patch new file mode 100644 index 0000000..9a916d9 --- /dev/null +++ b/target/linux/mediatek/patches-4.4/0083-net-next-mediatek-add-missing-return-code-check.patch @@ -0,0 +1,30 @@ +From 2206de729d8a873898b983f5ff7633a2489aa71c Mon Sep 17 00:00:00 2001 +From: John Crispin <blogic@openwrt.org> +Date: Sat, 23 Apr 2016 09:06:05 +0200 +Subject: [PATCH 83/91] net-next: mediatek: add missing return code check + +The code fails to check if the scratch memory was properly allocated. Add +this check and return with an error if the allocation failed. + +Signed-off-by: John Crispin <blogic@openwrt.org> +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +index 674e8e3..37e9260 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -483,6 +483,9 @@ static int mtk_init_fq_dma(struct mtk_eth *eth) + + eth->scratch_head = kcalloc(cnt, MTK_QDMA_PAGE_SIZE, + GFP_KERNEL); ++ if (unlikely(!eth->scratch_head)) ++ return -ENOMEM; ++ + dma_addr = dma_map_single(eth->dev, + eth->scratch_head, cnt * MTK_QDMA_PAGE_SIZE, + DMA_FROM_DEVICE); +-- +1.7.10.4 + |