From patchwork Thu Aug 25 17:44:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 9299631 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 23D1560757 for ; Thu, 25 Aug 2016 17:44:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19EFF293B3 for ; Thu, 25 Aug 2016 17:44:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E62B293B5; Thu, 25 Aug 2016 17:44:26 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 86BE1293B3 for ; Thu, 25 Aug 2016 17:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753343AbcHYRoY (ORCPT ); Thu, 25 Aug 2016 13:44:24 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:35337 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569AbcHYRoX (ORCPT ); Thu, 25 Aug 2016 13:44:23 -0400 Received: by mail-pa0-f67.google.com with SMTP id cf3so3425739pad.2; Thu, 25 Aug 2016 10:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=zwe6qZ9ei6AhrbdGkysVR1eTdJyRvdW9wJ92kJBLw+o=; b=zUOV1Mzhbi2t3VvIsBT7FvODEdw8eicAfl+B4zrh8AbmA3zbQlV7DM9yl7Txs5uKUW ZdQTKXV9IhtzDlm5hTrgeOSNO1QsQe5KK1e57ZvTerCmOId7gQCITTCFymV09zjTR4l9 2ZyPd86Wv81LYiIwLXrjsdGFCKfpCeWAKA+4FlM/A38lfJLkJZa/mST5putBcJkT8OdI 33vCffiaFYxUKspik/5xuVVUZA6Bjbev8a3Rqf1XVPhOmXOITDujHAGyIQ0x6cS3GU4E XtF90Khb7zLDYNKtlUXdmo5gyOYijP65K8EuE48CD9AJgpAI0df3MGW00GWXjF2PpJUP S7Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zwe6qZ9ei6AhrbdGkysVR1eTdJyRvdW9wJ92kJBLw+o=; b=IQXMbybMxJtZyJYhTHDmQnCMHLIw2jxWZuuVg4Tlcvt4K7Zqa2HYlBkZ3trcPXbP7c snKbR8QPCOf9uViJlCZb78omSgq4djjX7UsBoVC0JaxdccDU4RqMUqzNGJ3VLyaqZrvt vIIF9rNvl7o0Bk32+4JhRrrc2BOxMYQ8q0u27osA9xQCfBWGWcEfp7gHtS4Tq5GtmF/a 03OcY93n/FwSNYaDtp3t+fjx+ovCZTbkNYZjUeu+cfSxQKCy22RZiNMDCISX4EJs3zgo VDAlRfXwRixKNvIayKyYGG409HiCjdJONgrafkWAto3Nse+4jp1g4SMAsKk7TVf3kcFa M0VA== X-Gm-Message-State: AE9vXwMV4yNeC0uHU4s7dCy1Q8qXr6+sH3Iwm39vnG6jFRoqnHLREfBU58b4Eh/fM5fqiA== X-Received: by 10.66.232.37 with SMTP id tl5mr18301870pac.13.1472147063136; Thu, 25 Aug 2016 10:44:23 -0700 (PDT) Received: from localhost.localdomain ([103.24.124.194]) by smtp.gmail.com with ESMTPSA id vt10sm22391649pab.43.2016.08.25.10.44.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Aug 2016 10:44:22 -0700 (PDT) From: Sudip Mukherjee To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, Sudip Mukherjee Subject: [PATCH] matroxfb: fix size of memcpy Date: Thu, 25 Aug 2016 23:14:12 +0530 Message-Id: <1472147052-26921-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP hw->DACreg has a size of 80 bytes and MGADACbpp32 has 21. So when memcpy copies MGADACbpp32 to hw->DACreg it copies 80 bytes but only 21 bytes are valid. Signed-off-by: Sudip Mukherjee --- drivers/video/fbdev/matrox/matroxfb_Ti3026.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c index 195ad7c..68fa037 100644 --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c @@ -372,7 +372,7 @@ static int Ti3026_init(struct matrox_fb_info *minfo, struct my_timming *m) DBG(__func__) - memcpy(hw->DACreg, MGADACbpp32, sizeof(hw->DACreg)); + memcpy(hw->DACreg, MGADACbpp32, sizeof(MGADACbpp32)); switch (minfo->fbcon.var.bits_per_pixel) { case 4: hw->DACreg[POS3026_XLATCHCTRL] = TVP3026_XLATCHCTRL_16_1; /* or _8_1, they are same */ hw->DACreg[POS3026_XTRUECOLORCTRL] = TVP3026_XTRUECOLORCTRL_PSEUDOCOLOR;