Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2210457imu; Thu, 17 Jan 2019 10:10:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN6aENPEMdXfhYS10TXssNJK1QFS6xpyJAjX8bGDMjYVcjgonKcFRz4/tuWsQ5OA7NDzlASu X-Received: by 2002:a63:fd53:: with SMTP id m19mr14536555pgj.340.1547748604900; Thu, 17 Jan 2019 10:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547748604; cv=none; d=google.com; s=arc-20160816; b=Tx8cnL7JdQZdCNM5+L9ckndTOylBqB+V5U/6/xI4JfAVlc1Dr8pgSB2I8RWVpfrtIm 6g4+i2jwiMYviHjQcERS5uRTLAiT/LadDwM3GCM6tpndfEQTMsjLTDezYGv427l8K/eR 5FIRVWFuRWE9YWf30LofureLi/pfmLSu9swuuyt8e+diamGZtpOZoJj9uhUCPTJo94pn XEZyuiWY4jywOpPDR4IB/z4s/FyXw7Ce0rwXYoNoWVXtOmjpioKaFsUHV/uZGf3os4Nb 4WmOf9pJs97Z0//lMDRA6sBnbna4n5jGT6ZRjv4MmXj9y1R4L1Emm4EZKpvCzC26EqyK zk4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=MkbOUFHDsrDG1TGvqhepL8zE+1a5aus1syCufXPfhww=; b=koctkOpYdHdVLhiTQWNepFMPkN7zH5+TiHl3eu5sB0rnVS/ifLhk31HiitQNk2HtIn QvsQM85rBD3JET1GnVjEb36/R59aupKKY6WwvUMzzTSWXVQis6xDTe4G26dj+dBuh9zm hIPV9XSRpFXPkYZvveQsO+4AwX3W/Gw6110EjWNkDkzvgSQTxeO/55jjK6dma6r8E9XK JVWQ6kwVz7eJcFCyUCCC5+ylw5tn+qYqRKAaqjfXWOI9B4vzBvht3EvPf3exdTMghuXF I1a/r6n/W/HhGwL8/7Y69cJgXDipBpUNnW8LtCXtfxTn6IDsVYLjepHSbZNBg9HmNsFa Dcfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WRKhZf4R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si445834pgo.166.2019.01.17.10.09.49; Thu, 17 Jan 2019 10:10:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WRKhZf4R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729297AbfAQQVh (ORCPT + 99 others); Thu, 17 Jan 2019 11:21:37 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52214 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729105AbfAQQVJ (ORCPT ); Thu, 17 Jan 2019 11:21:09 -0500 Received: by mail-wm1-f68.google.com with SMTP id b11so1699510wmj.1 for ; Thu, 17 Jan 2019 08:21:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MkbOUFHDsrDG1TGvqhepL8zE+1a5aus1syCufXPfhww=; b=WRKhZf4RUsxe3qwNVAqkut2X4sPhjyKbKboB/6lzkNvpEPB690MAHkE9otoCgA3iCa sEDi+1WICELvvqYkxsUIfeEexgdDrAxRPeJ/eF/uJ05JRhnj4kyyrIouRwEqMwAe11Go Iv9bcBTxbyPc2omRNkdybZCKrY7uq19n5v19g= 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; bh=MkbOUFHDsrDG1TGvqhepL8zE+1a5aus1syCufXPfhww=; b=tIkROK809nudcrWoXk24D+4+6T/bQ3rfKnv+e2ZERroihJDRDI5SmMZmeP8xEUbo9g 1nxZEhelMQhi3JDIfmvG6XFILKtIqMc8ZMyLdPpzS8pNBXIFqCxHq2BcprufkzQerzUu b/E+GFHW6LgjaUvgOH3RB/RAPrZm6eyAMoNcYcfUmAL2RUWfRM9CnkLR6hB4zU6LhaNq +7s8IQ+ZmLc9DakY5bXbYNJVRZ/SBfAuJNzRMZKfKCZzc0/2xxI6yFB+fephDN2Iy6ZM MxJ7Wp/TDM3EbMrbX1L7qKYr3wF1d17DQorQCEWHWAhJT9lO0OdeWWUugCt+IIZR+VWm i5eg== X-Gm-Message-State: AJcUukddp1ArnzMr1dmQVls/MtemkGahPTXpe+6o+e4VuRW0M/NYaWmv RgnFtFsYDl2n36AigCtKr4xFrw== X-Received: by 2002:a1c:9d57:: with SMTP id g84mr12654932wme.16.1547742068013; Thu, 17 Jan 2019 08:21:08 -0800 (PST) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id v133sm31124734wmf.19.2019.01.17.08.21.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 08:21:07 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Alexandre Courbot , Malathi Gottam , Stanimir Varbanov Subject: [PATCH 06/10] venus: hfi: return an error if session_init is already called Date: Thu, 17 Jan 2019 18:20:04 +0200 Message-Id: <20190117162008.25217-7-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190117162008.25217-1-stanimir.varbanov@linaro.org> References: <20190117162008.25217-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This makes hfi_session_init to return an error when it is already called without a call to hfi_session_deinit. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c index eaa82af9ec09..5374655eda39 100644 --- a/drivers/media/platform/qcom/venus/hfi.c +++ b/drivers/media/platform/qcom/venus/hfi.c @@ -207,6 +207,9 @@ int hfi_session_init(struct venus_inst *inst, u32 pixfmt) const struct hfi_ops *ops = core->ops; int ret; + if (inst->state != INST_UNINIT) + return -EINVAL; + inst->hfi_codec = to_codec_type(pixfmt); reinit_completion(&inst->done); -- 2.17.1