Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1132652pxk; Mon, 31 Aug 2020 10:37:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXbEAwspHXhdeUlG7685iReTlZngYNU3umC8XruEd9vW9eMYx7vG74V/BJQb/qLlRKNseM X-Received: by 2002:a17:906:f8d1:: with SMTP id lh17mr1953356ejb.409.1598895474524; Mon, 31 Aug 2020 10:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598895474; cv=none; d=google.com; s=arc-20160816; b=Wv/uIGV1fyqANxJN/bH3TO2KyFhxACEc8xaGLTAR+tnVkqz4Mqk9egByN+8CFMUICK rZer02bT5vhmG49nHzaL78Lh0wS5uZj17KlqpuAiNkrjUdmhVT3aMDEjcIMKTZTP0Ip9 KXqW0ZnL1DVzGUlLwQoesKRBiMcFZRJ2jev0COFJH/WQatXJZTlkBwaXEurzEO3jAk7C ccMmbALCjdpUN2awETwXEaAYRDs5r+WPCoQOMNZS1JUX/bcOFeEIB/XYlB0IitmqrS0Y gvv3tFSgvWR8qgeClSLzHcP4exGOmyMnfzj1iGO9kdDfcfOHYn/YCCCpE3EVzOlneBKz E6Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :user-agent:subject:cc:to:from:date:mime-version; bh=JsU/EyUsw03lsu3XVy4izXfwVMueLEEnl3xhpMvVC74=; b=pW1m2e3wLt+V+SToHKuqCtv4hILBs7QGiTEsKXa+64Uui/iKxTt9Hbj77Nhxyvk4yn WUC8Q491k4zdZKHivnm7wWsB+3UEJDr37IGuP77f2rM2efEErgoxJObZkUnOaf2lo3Fc NOoRxdgWDrdJk4mG1LpRQLkYzELWE036iNb6CQt4jsoPbSmiBQQe4zSjlDzT0mZI8jRz axyy7b8duwwy9jtKHC5GAWA1u+0TM6jFibmWF+qgPcovexHDStR8gf4gj4UGzF/6RQ2q AJQvn/XjEwxwlXnLNkHjjYas+TPazpsm4E7oNjDQmSbZePsjvSzunm4B0IUdXSLYDeVp k00Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si5379133ejb.340.2020.08.31.10.37.32; Mon, 31 Aug 2020 10:37:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726117AbgHaRdM (ORCPT + 99 others); Mon, 31 Aug 2020 13:33:12 -0400 Received: from mail.ispras.ru ([83.149.199.84]:45078 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbgHaRdM (ORCPT ); Mon, 31 Aug 2020 13:33:12 -0400 Received: from mail.ispras.ru (unknown [83.149.199.84]) by mail.ispras.ru (Postfix) with ESMTPSA id 72BAF40D4004; Mon, 31 Aug 2020 17:33:09 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 31 Aug 2020 20:33:09 +0300 From: lutovinova@ispras.ru To: peter.senna@gmail.com Cc: martin.donnelly@ge.com, martyn.welch@collabora.co.uk, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org, lutovinova@ispras.ru Subject: fotg210-udc: Error in type cast in fotg210_in_fifo_handler() User-Agent: Roundcube Webmail/1.4.4 Message-ID: X-Sender: lutovinova@ispras.ru Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If in fotg210_udc_probe() after initialization INIT_LIST_HEAD(&ep->queue) and after a registration of an interrupt handler in fotg210_irq() fotg210_in_fifo_handler() is calling then in fotg210_in_fifo_handler() list_entry() tries to get struct fotg210_request from ep->queue.next, but after initialization ep->queue.next is from struct fotg210_udc. Also this problem appears in fotg210_out_fifo_handler(). In fotg210_ep0in() and fotg210_ep0out() there is checking by list_empty() before calling list_entry (). Found by Linux Driver Verification project (linuxtesting.org).