From patchwork Thu Jan 17 16:20:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 155840 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2158762jaa; Thu, 17 Jan 2019 08:21:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN7WIJ0/Lxe8PK0j2BsN4GMCIsNdLprBdKSEPL7xgOJYXX0732Mcs8zufbTwz8towk4Mw8K3 X-Received: by 2002:a17:902:d68c:: with SMTP id v12mr15481202ply.4.1547742072867; Thu, 17 Jan 2019 08:21:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547742072; cv=none; d=google.com; s=arc-20160816; b=QWoPVeAaFLsUxAgdrPeJmaNhoCndK9DYz6ftXo3PEJvaVgyHtW+1H4FrlO/GZOTMCn CeRiEtHar6ba2oWp4gTBu8kGZ8RluR9j7cBM1fQKfWCQl34cOY07ElFSI+e1sQhWTvfS 4fiXDSREqp4TsNv9+14f9eSt/5s//kM7RNYiWe1U09ayiF9HenPchb7tvzYJVgg0iBBX DC9fB+fjB0i9mDkDr23AP7ZQatnCd7Pm0CvFQ2vUSSxD0QDwvFo0jg4YnSDrpFaSVNef fBA1GQQPF5TPy+XwbRPXjWa+BA10bShD/A9CM9nI/svMnQXlbfeckgVDPVP7Vm156my7 FNLA== 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=N8RVOv0o+5j6OP9jpkvdVbGBJvncaQFKCMGvHSEIKMSG0raRvw1/9ZcTGBfG74HSFY wt+lfHehYmydYcTbJRS8eZFIUVjRPPeCYh0vnxqKTiw1LXWn6hhitOiNO+LLjYOK94Xp ZS6NS5rcAWCyX6etaygQ3B+nltHi/Kb6bwYOmTIikN/+ccFj61lM/7yfrlw4m6rgITpi 5MJUgTrAQQ9rdCtTYOZQ/McuDRgXwSr5SKfh8meGYH+Fj81ZE1RIIafSd0aObo0/okUm E95eNbt9A+kB7tkvEW1NF3MjFj6wjzHGIPwR4JBj+rNCkBAkWooy5SYtdTPpxEHy+0Dg rrXA== 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-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 r17si1958855pls.380.2019.01.17.08.21.12; Thu, 17 Jan 2019 08:21:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-media-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-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 S1729130AbfAQQVL (ORCPT + 4 others); Thu, 17 Jan 2019 11:21:11 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52324 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729108AbfAQQVK (ORCPT ); Thu, 17 Jan 2019 11:21:10 -0500 Received: by mail-wm1-f68.google.com with SMTP id m1so1694172wml.2 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=CP7LgLa6eF02d2ojurFnh6H0KiaiRnxuuxj/Vo+i41rQISQWfeW8Vp3381IwD1/f8n 4FWQy2QybrC/TDaVsd6/u6ohPwe++ZVsLfFleURUdp8s8mDq01iWGInl4wb2fUyRn2nt oPkkG8pF7ehkDJc9NdHCSuIehSznkWcB42JImUGaoISF9E1ApPBeU39A8U3HSXZ2yp6J M8FWqnYOxDlguTUsEqAvHLU76XctORg13X+03OWtKDEU9kw8lTa6455EzD+DwBQJx4b1 +A6ykZNw0pg+EPUoUXZ7wys0IxYxmBbnd97I9u8ddSA7E9kI9q8GbifawvCjNonOUm3y zUJw== X-Gm-Message-State: AJcUukdqM3aXFIcxA7xppBbNz5POXU0WdP+43/fLGTeurlaFdDtYyKUi 9SKiEJDbyV8hAuXvwjxzh1b9RLt5Lb8= 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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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(+) -- 2.17.1 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);