]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
rasdaemon: fix the issue that non standard decoder can't work in pthread way
authorXiaofei Tan <tanxiaofei@huawei.com>
Wed, 27 May 2020 08:02:33 +0000 (16:02 +0800)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 21 Jul 2020 11:19:22 +0000 (13:19 +0200)
The non standard decoding functions are registered in app init process
through __attribute__((constructor)), and unregistered in app exit process
through __attribute__((destructor)). We don't need to unregister them
in any other steps. This patch removes these unnecessary unregister calls.

Fixes: 78a21c1e9770 ("rasdaemon: add closure and cleanups for the database")
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
ras-events.c

index 5635278fe46a0756b1d61d36a5ff0a6f14cff3e4..e6c89ddd54da352cc1cced8672ecb0408f515dbf 100644 (file)
@@ -496,10 +496,8 @@ static int read_ras_event_all_cpus(struct pthread_data *pdata,
            "Old kernel detected. Stop listening and fall back to pthread way.\n");
 
 cleanup:
-       if (pdata[0].ras->record_events) {
-               unregister_ns_dec_tab();
+       if (pdata[0].ras->record_events)
                ras_mc_event_closedb(pdata[0].cpu, pdata[0].ras);
-       }
 
 error:
        kbuffer_free(kbuf);
@@ -598,10 +596,8 @@ static void *handle_ras_events_cpu(void *priv)
 
        read_ras_event(fd, pdata, kbuf, page);
 
-       if (pdata->ras->record_events) {
-               unregister_ns_dec_tab();
+       if (pdata->ras->record_events)
                ras_mc_event_closedb(pdata->cpu, pdata->ras);
-       }
 
        close(fd);
        kbuffer_free(kbuf);