From patchwork Mon Jan 30 15:59:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 9545659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A1A9A604A8 for ; Mon, 30 Jan 2017 16:02:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93DFC27F86 for ; Mon, 30 Jan 2017 16:02:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 889BE28159; Mon, 30 Jan 2017 16:02:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A235127FAD for ; Mon, 30 Jan 2017 16:02:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932246AbdA3QC3 (ORCPT ); Mon, 30 Jan 2017 11:02:29 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:59561 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753632AbdA3QC1 (ORCPT ); Mon, 30 Jan 2017 11:02:27 -0500 Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKL024V4OF30T80@mailout2.samsung.com>; Tue, 31 Jan 2017 00:59:27 +0900 (KST) Received: from epsmges5p3.samsung.com (unknown [182.195.42.46]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20170130155926epcas5p29a83f2a6c68813174583dc0cfb7ccc0f~el_vvn6qD2871528715epcas5p2v; Mon, 30 Jan 2017 15:59:26 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3.samsung.com (EPCPMTA) with SMTP id B3.AA.04850.ED26F885; Tue, 31 Jan 2017 00:59:26 +0900 (KST) Received: from epcpsbgm2new.samsung.com (u27.gpu120.samsung.co.kr [203.254.230.27]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20170130155925epcas5p2eb7261871793488fb6d181ff509b469d~el_unP4sL1238512385epcas5p2Y; Mon, 30 Jan 2017 15:59:25 +0000 (GMT) X-AuditID: b6c32a2e-f79656d0000012f2-10-588f62dea9bd Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 36.66.06428.DD26F885; Tue, 31 Jan 2017 00:59:25 +0900 (KST) Received: from amdc3058.localnet ([106.120.53.102]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKL00GG3OEZHN80@mmp1.samsung.com>; Tue, 31 Jan 2017 00:59:25 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Arvind Yadav Cc: jejb@parisc-linux.org, deller@gmx.de, linux-parisc@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] video : fbdev : stifb :- Handle return NULL error from ioremap_nocache. Date: Mon, 30 Jan 2017 16:59:22 +0100 Message-id: <1759269.Z5Z5RrJiUP@amdc3058> User-Agent: KMail/4.13.3 (Linux/3.13.0-96-generic; KDE/4.13.3; x86_64; ; ) In-reply-to: <1484734911-5299-1-git-send-email-arvind.yadav.cs@gmail.com> MIME-version: 1.0 Content-transfer-encoding: 7Bit Content-type: text/plain; charset=us-ascii X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupileLIzCtJLcpLzFFi42LZd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qsUoesbEqSkUJaYUwrkGRmgAQfnAPdgJX27BLeMl7fO sRT85q14+f4sYwPja+4uRk4OCQETicmTp7JA2GISF+6tZwOxhQSWMkqc3whkcwHZXxkltu7a D5ZgE7CSmNi+ihHEFhHQkdg08zcjSBGzQDOjxPRFU5hBEsICiRLr1m0Ea2ARUJU48+cY2AZe AU2Jby+b2UFsUQEviS372plAbE4BT4nXdxpYIbbNY5SYf6UfqkFQ4sfke2A2s4C8xL79U1kh bC2J9TuPM01gFJiFpGwWkrJZSMoWMDKvYpRILUguKE5KzzXKSy3XK07MLS7NS9dLzs/dxAiO qGfSOxgP73I/xCjAwajEwzvBuz9CiDWxrLgy9xCjBAezkghvQBxQiDclsbIqtSg/vqg0J7X4 EKMp0IcTmaVEk/OB0Z5XEm9oYm5ibmxgYW5paWKkJM7bOPtZuJBAemJJanZqakFqEUwfEwen VAMjY9iJ78sFVjku4/SxZ9sqeSJBZaXhCvVTpWdP9+/vWceT8ab/7ydW9VUa/0/vju1eULe3 +HKNfmvuc/NN/0rlFXQtS/g9H0+fJlcYMF2AN1F7+jbh3Y/tKrmZON8+uuRkotFwRzUy1fDr nDX3lXkZxPcnuG9iPZv0wFz89IurV45+5xdgfZioxFKckWioxVxUnAgAYgwo6r4CAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170130155925epcas5p2eb7261871793488fb6d181ff509b469d X-Msg-Generator: CA X-Sender-IP: 203.254.230.27 X-Local-Sender: =?UTF-8?B?QmFydGxvbWllaiBab2xuaWVya2lld2ljehtTUlBPTC1LZXJu?= =?UTF-8?B?ZWwgKFRQKRvsgrzshLHsoITsnpAbU2VuaW9yIFNvZnR3YXJlIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?QmFydGxvbWllaiBab2xuaWVya2lld2ljehtTUlBPTC1LZXJu?= =?UTF-8?B?ZWwgKFRQKRtTYW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBF?= =?UTF-8?B?bmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 105P X-HopCount: 7 X-CMS-RootMailID: 20170118102229epcas1p21c74a99299ee919a3f2d28ad435b7ca7 X-RootMTR: 20170118102229epcas1p21c74a99299ee919a3f2d28ad435b7ca7 References: <1484734911-5299-1-git-send-email-arvind.yadav.cs@gmail.com> Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On Wednesday, January 18, 2017 03:51:51 PM Arvind Yadav wrote: > Here, If ioremap_nocache will fail. It will return NULL. > Kernel can run into a NULL-pointer dereference. > This error check will avoid NULL pointer dereference. > > Signed-off-by: Arvind Yadav Thanks, I queued your patch with some minor changes for 4.11 (you can see the final version of the patch below). Best regards, --- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics From: Arvind Yadav Subject: [PATCH v1] video: fbdev: stifb: handle NULL return value from ioremap_nocache Add missing error check for ioremap_nocache() failure (prevents NULL pointer dereference on error). Cc: "James E.J. Bottomley" Cc: Helge Deller Signed-off-by: Arvind Yadav [b.zolnierkie: minor fixes] Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/video/fbdev/stifb.c | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: b/drivers/video/fbdev/stifb.c =================================================================== --- a/drivers/video/fbdev/stifb.c 2017-01-30 16:55:15.766435453 +0100 +++ b/drivers/video/fbdev/stifb.c 2017-01-30 16:55:15.750435453 +0100 @@ -1294,6 +1294,10 @@ static int __init stifb_init_fb(struct s strcpy(fix->id, "stifb"); info->fbops = &stifb_ops; info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len); + if (!info->screen_base) { + printk(KERN_ERR "stifb: failed to map memory\n"); + goto out_err0; + } info->screen_size = fix->smem_len; info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA; info->pseudo_palette = &fb->pseudo_palette;