From patchwork Fri Jun 28 12:59:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 168083 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3670156ilk; Fri, 28 Jun 2019 06:00:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+1STLmhPVrpMVFWpqjAGlhyOC1cbVO5UjjeXXimqXfNIdCBneO3s/qp2Bw10tf+WN9pxV X-Received: by 2002:a65:4342:: with SMTP id k2mr9231414pgq.218.1561726838793; Fri, 28 Jun 2019 06:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561726838; cv=none; d=google.com; s=arc-20160816; b=GnNM47W2Lb/fkD+4NBA8RfE7eLbhFKtmQvVr5NzisyKRhekicQ6q57yaoOGGKLtFSb H2x5gL0QWqddq5FU36ey3VcvemNNzPfzTyHScy8nmHTYUEgUe4b4oFp+7U6v0bdF2/C7 bB7KMLSGG1rg0WonidU7Hzf17aWp+ogpYSTeIC4iDmGiR+wKLP7jzrjH+g7zu1huZWud zzl09XxO85z+3+bp4xGKRZdWMir1XRJxj/Pkx0bP6WOYxtQ4iNSXJDUztN0H2xhPgQBz l0nZe9vS0yBbVZ6REf0ir7Yan80Hr3Hw769gdNFM5zm5wh2JEuI2NQnwsSfSjYB7E5g8 d2UQ== 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=GDdYN5kQt5oodJg9h0fQ+PGqnlQ6057Y5ThAbiMCFHE=; b=kGbvqMoLkkF1bZokJqFpkPGjhMQE1yLpcLXZLV9EavejHQCinZ70lglGPrwZ3n2zES vPHkvoN/D0Aermfyy9IaOxYSem2hNId48XwUzR1L5ZHIEgIVmNUi37UVvPbliQSLMOht vnCtiUYeshFhE/flJCC95EYtjd+AYo5DdJtviwpspuRhxwD2N1O0X1BFnFmUJx1SfNfV yHJk0rMkKxn/vIxMIZmYcjgybOdGFlY5Tlr7iRMNGs24Vz2Z0JUm8T63Y3JfOOAVA7nS 3N95X2vFaeeWgwK7troh+wsEPyU0VoI5p6u8IUyOsITlci26wJeLSuqDsCn35qluB2b/ 4xGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aStCg4Hr; 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 y4si2042833pgi.556.2019.06.28.06.00.38; Fri, 28 Jun 2019 06:00:38 -0700 (PDT) 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=aStCg4Hr; 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 S1727219AbfF1NAh (ORCPT + 30 others); Fri, 28 Jun 2019 09:00:37 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46016 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727180AbfF1NAe (ORCPT ); Fri, 28 Jun 2019 09:00:34 -0400 Received: by mail-wr1-f66.google.com with SMTP id f9so6174709wre.12 for ; Fri, 28 Jun 2019 06:00:33 -0700 (PDT) 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=GDdYN5kQt5oodJg9h0fQ+PGqnlQ6057Y5ThAbiMCFHE=; b=aStCg4HrF6BmAN5ZprxLweMHT3TIAHKj9unAhcfV7uHqCXxK/8cTWppGWhbH6ZIp28 X1QPv8tS/qz0Nlfbj4S7cWYVVp7LxyG+w+c6yBHwIHX3raV4D1AfsFzmFUuBghwvbcFv b+W4geq0zgQs+TlGDuYDGhYHSWbOaXWX1d35Ijn1iH7mZcWV8bjjBoQo3AFPPkWcg1eW 24QBV7tmPeX4wF/K953B6FL5UGulav6XLBmO+/XtUGvPCh42HQObW993Q35MrOM2mhxa 7fHSc/28OoOlsMRatKMoqX1LuISEQ6/3YoixCLbhReBc7C4wC8aX16RVtlAOmpCJEZha 30IQ== 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=GDdYN5kQt5oodJg9h0fQ+PGqnlQ6057Y5ThAbiMCFHE=; b=fnt7VYx0I+waOMOlyI+Fz/3eKKgxBM2ZNgfEWBPwLdzP0kRacme+JIQtFyOGAlTwcg XQ18inWA1yuS8tNaWMh9+3pubtA9QR+IqLcw00iAmmSeBewxXPwcfRgkd+uGyj6CZOgA 5UhH+3g5g2RWTXBbgryDdf6mGoFgBXlNgZmvRWCc41/TcVtd+aJ7tSROsc+QzxVwQxSB lfVf0xesJ9dVy+HBpmG9YWgAU9VXLZ6TSossbrorxgVhsEWJ16GEtRBc1fRaazg7745v QpdF+r0hi3xW3ZH6xq+l0Q5TTeYeBdCZY/3BLBG5jvIzQQurR3MOUWDTm3gYOeLcs1lU yyHg== X-Gm-Message-State: APjAAAUiZc/gMMLSoVmQKeoxTO5CdnyB4cHFnxUMTBFSN8UUk+KCLEa5 TV+GlVILNAEgT7eskbvhr16hsQ== X-Received: by 2002:adf:e2c7:: with SMTP id d7mr7602029wrj.272.1561726832700; Fri, 28 Jun 2019 06:00:32 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id w20sm3717174wra.96.2019.06.28.06.00.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 28 Jun 2019 06:00:32 -0700 (PDT) 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 , Stanimir Varbanov Subject: [PATCH v2 05/11] venus: hfi: return an error if session_init is already called Date: Fri, 28 Jun 2019 15:59:56 +0300 Message-Id: <20190628130002.24293-6-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190628130002.24293-1-stanimir.varbanov@linaro.org> References: <20190628130002.24293-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(+) -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c index 82eb889ab541..3d8b1284d1f3 100644 --- a/drivers/media/platform/qcom/venus/hfi.c +++ b/drivers/media/platform/qcom/venus/hfi.c @@ -198,6 +198,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);