From patchwork Fri Sep 6 11:55:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 11135057 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 975CD1731 for ; Fri, 6 Sep 2019 11:55:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 780C4214DE for ; Fri, 6 Sep 2019 11:55:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="j0fpr0SZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391334AbfIFLzd (ORCPT ); Fri, 6 Sep 2019 07:55:33 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41019 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390223AbfIFLzd (ORCPT ); Fri, 6 Sep 2019 07:55:33 -0400 Received: by mail-pg1-f193.google.com with SMTP id x15so3369900pgg.8 for ; Fri, 06 Sep 2019 04:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+OhbUrYZqce0AMoF+F11Glo98JJ+mfowWQPDmtjNy0c=; b=j0fpr0SZSekbxfXZ1FC/pKVVDJOVri+GMbhaUUg0GN7iFcJUJbsxYR2ufhju7H4jFa Jv5dNhGX1Oqtv4RcGth4eaQdF8yVq5LeliVMFrfqFwvuiRhpX30n+RWuTHUTalX6WKus REzcBschvcwWBSNcVBdtu2HD0ERIb/mvo+mT8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+OhbUrYZqce0AMoF+F11Glo98JJ+mfowWQPDmtjNy0c=; b=VNGy39WbtCtmZcq3B63qU56csl4AyBW3gARLulYWUe/qq18Bi7smOgKBYbiHbBLGy1 Bl2DR+J3DrvWjPh3kNPwi/21/xEa9feMpuAKXb+O03xcVM3zAmAsMpa5kVGwNUuaHkxR M4nHVpDEWTn9kpO1Bz45Eb/FZTftzDPGqD3gU8Nye4KEIssylYijBbtgCPC6SqLdaUtB i+loLvIO08WHrEa1xVWrsfZyNIIGc7Z/UrzeFe/9tghkzP7JOko+88nri7X7rBql2tf7 c0ef46biimq4+XB64dj5F/WuE25+1yDFFZymExy9pG6ID/vl51dTqqz2EkTCEmvExFR1 HKog== X-Gm-Message-State: APjAAAUOyBRwy6lX2m7XuL/kFxDbE+idIoV9UeffqWMvYu0vhFp68wYr Xv5VQPSMnFANOwcXgMRampj0zg== X-Google-Smtp-Source: APXvYqy4WC4joqsKUtL19abRcSKOqjJJ+pZZ5uFtnSaqIUEDo7bsKgApsUMm4LCY1XtDNk4LXigH1g== X-Received: by 2002:a17:90a:264a:: with SMTP id l68mr9420784pje.74.1567770932661; Fri, 06 Sep 2019 04:55:32 -0700 (PDT) Received: from acourbot.tok.corp.google.com ([2401:fa00:4:4:9712:8cf1:d0f:7d33]) by smtp.gmail.com with ESMTPSA id o22sm3667394pjq.21.2019.09.06.04.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 04:55:32 -0700 (PDT) From: Alexandre Courbot To: Yunfei Dong , Tiffany Lin , Andrew-CT Chen , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [RFC PATCH v2 01/13] media: mtk-vcodec: vdec: fix incorrect pointer dereference Date: Fri, 6 Sep 2019 20:55:01 +0900 Message-Id: <20190906115513.159705-2-acourbot@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190906115513.159705-1-acourbot@chromium.org> References: <20190906115513.159705-1-acourbot@chromium.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Yunfei Dong mtk_q_data::fmt is actually a pointer and must be dereferenced as such. This went under the radar because mtk_v4l2_debug() evaluates to nothing unless DEBUG is defined. Signed-off-by: Yunfei Dong [acourbot: split into its own commit] Signed-off-by: Alexandre Courbot --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c index 26a55c3e807e..653f111532ab 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c @@ -284,7 +284,7 @@ static void mtk_vdec_update_fmt(struct mtk_vcodec_ctx *ctx, fmt = &mtk_video_formats[k]; if (fmt->fourcc == pixelformat) { mtk_v4l2_debug(1, "Update cap fourcc(%d -> %d)", - dst_q_data->fmt.fourcc, pixelformat); + dst_q_data->fmt->fourcc, pixelformat); dst_q_data->fmt = fmt; return; }